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

Function createAsset

media/livestream/createAsset.js:34–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32 const livestreamServiceClient = new LivestreamServiceClient();
33
34 async function createAsset() {
35 // Construct request
36 const request = {
37 parent: livestreamServiceClient.locationPath(projectId, location),
38 assetId: assetId,
39 asset: {
40 video: {
41 uri: assetUri,
42 },
43 },
44 };
45
46 // Run request
47 const [operation] = await livestreamServiceClient.createAsset(request);
48 const response = await operation.promise();
49 const [asset] = response;
50 console.log(`Asset: ${asset.name}`);
51 }
52
53 createAsset();
54 // [END livestream_create_asset]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected