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

Function main

media/transcoder/listJobs.js:18–45  ·  view source on GitHub ↗
(projectId, location)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location) {
19 // [START transcoder_list_jobs]
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 Transcoder library
27 const {TranscoderServiceClient} =
28 require('@google-cloud/video-transcoder').v1;
29
30 // Instantiates a client
31 const transcoderServiceClient = new TranscoderServiceClient();
32
33 async function listJobs() {
34 const iterable = await transcoderServiceClient.listJobsAsync({
35 parent: transcoderServiceClient.locationPath(projectId, location),
36 });
37 console.info('Jobs:');
38 for await (const response of iterable) {
39 console.log(response.name);
40 }
41 }
42
43 listJobs();
44 // [END transcoder_list_jobs]
45}
46
47// node listJobs.js <projectId> <location>
48process.on('unhandledRejection', err => {

Callers 1

listJobs.jsFile · 0.70

Calls 1

listJobsFunction · 0.70

Tested by

no test coverage detected