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

Function main

media/livestream/getInput.js:18–44  ·  view source on GitHub ↗
(projectId, location, inputId)

Source from the content-addressed store, hash-verified

16'use strict';
17
18function main(projectId, location, inputId) {
19 // [START livestream_get_input]
20 /**
21 * TODO(developer): Uncomment these variables before running the sample.
22 */
23 // projectId = 'my-project-id';
24 // location = 'us-central1';
25 // inputId = 'my-input';
26
27 // Imports the Livestream library
28 const {LivestreamServiceClient} = require('@google-cloud/livestream').v1;
29
30 // Instantiates a client
31 const livestreamServiceClient = new LivestreamServiceClient();
32
33 async function getInput() {
34 // Construct request
35 const request = {
36 name: livestreamServiceClient.inputPath(projectId, location, inputId),
37 };
38 const [input] = await livestreamServiceClient.getInput(request);
39 console.log(`Input: ${input.name}`);
40 }
41
42 getInput();
43 // [END livestream_get_input]
44}
45
46// node getInput.js <projectId> <location> <inputId>
47process.on('unhandledRejection', err => {

Callers 1

getInput.jsFile · 0.70

Calls 1

getInputFunction · 0.85

Tested by

no test coverage detected