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

Function main

media/transcoder/getJobTemplate.js:18–49  ·  view source on GitHub ↗
(projectId, location, templateId)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, templateId) {
19 // [START transcoder_get_job_template]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // templateId = 'my-job-template';
26
27 // Imports the Transcoder library
28 const {TranscoderServiceClient} =
29 require('@google-cloud/video-transcoder').v1;
30
31 // Instantiates a client
32 const transcoderServiceClient = new TranscoderServiceClient();
33
34 async function getJobTemplate() {
35 // Construct request
36 const request = {
37 name: transcoderServiceClient.jobTemplatePath(
38 projectId,
39 location,
40 templateId
41 ),
42 };
43 const [jobTemplate] = await transcoderServiceClient.getJobTemplate(request);
44 console.log(`Job template: ${jobTemplate.name}`);
45 }
46
47 getJobTemplate();
48 // [END transcoder_get_job_template]
49}
50
51// node getJobTemplate.js <projectId> <location> <templateId>
52process.on('unhandledRejection', err => {

Callers 1

getJobTemplate.jsFile · 0.70

Calls 1

getJobTemplateFunction · 0.85

Tested by

no test coverage detected