MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / main

Function main

media/livestream/updatePool.js:18–57  ·  view source on GitHub ↗
(projectId, location, poolId, peeredNetwork)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, poolId, peeredNetwork) {
19 // [START livestream_update_pool]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // poolId = 'my-pool';
26 // peeredNetwork = 'projects/my-network-project-number/global/networks/my-network-name';
27
28 // Imports the Livestream library
29 const {LivestreamServiceClient} = require('@google-cloud/livestream').v1;
30
31 // Instantiates a client
32 const livestreamServiceClient = new LivestreamServiceClient();
33
34 async function updatePool() {
35 // Construct request
36 const request = {
37 pool: {
38 name: livestreamServiceClient.poolPath(projectId, location, poolId),
39 networkConfig: {
40 peeredNetwork: peeredNetwork,
41 },
42 },
43 updateMask: {
44 paths: ['network_config'],
45 },
46 };
47
48 // Run request
49 const [operation] = await livestreamServiceClient.updatePool(request);
50 const response = await operation.promise();
51 const [pool] = response;
52 console.log(`Updated pool: ${pool.name}`);
53 }
54
55 updatePool();
56 // [END livestream_update_pool]
57}
58
59// node updatePool.js <projectId> <location> <poolId>
60process.on('unhandledRejection', err => {

Callers 1

updatePool.jsFile · 0.70

Calls 1

updatePoolFunction · 0.85

Tested by

no test coverage detected