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

Function main

media/video-stitcher/listCdnKeys.js:18–47  ·  view source on GitHub ↗
(projectId, location)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location) {
19 // [START videostitcher_list_cdn_keys]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25
26 // Imports the Video Stitcher library
27 const {VideoStitcherServiceClient} =
28 require('@google-cloud/video-stitcher').v1;
29 // Instantiates a client
30 const stitcherClient = new VideoStitcherServiceClient();
31
32 async function listCdnKeys() {
33 const iterable = await stitcherClient.listCdnKeysAsync({
34 parent: stitcherClient.locationPath(projectId, location),
35 });
36 console.info('CDN keys:');
37 for await (const response of iterable) {
38 console.log(response.name);
39 }
40 }
41
42 listCdnKeys().catch(err => {
43 console.error(err.message);
44 process.exitCode = 1;
45 });
46 // [END videostitcher_list_cdn_keys]
47}
48
49// node listCdnKeys.js <projectId> <location>
50main(...process.argv.slice(2));

Callers 1

listCdnKeys.jsFile · 0.70

Calls 1

listCdnKeysFunction · 0.85

Tested by

no test coverage detected