This page shows you how to create and manage Live Stream API channels. A channel resource represents the processor that does a user-defined "streaming" operation. The streaming operation includes getting an input stream through an input endpoint, transcoding the input stream into multiple renditions, and publishing output live streams in certain formats in the specified location.
Set up your Google Cloud project and authentication
If you have not created a Google Cloud project and credentials, see Before you begin.Prerequisites
Create a channel
To create a channel, use the
projects.locations.channels.create
method. The following samples create a channel that generates an HLS live stream.
The live stream consists of a single, high-definition (1280x720) rendition.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location in which to create the channel; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the channel to create; this value must be 1-63 characters, begin and end withCHANNEL_ID [a-z0-9]
, and can contain dashes (-) between characters
: the user-defined identifier for the input endpointINPUT_ID
: the name of the Cloud Storage bucket you created to hold the live stream manifest and segment filesBUCKET_NAME
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
cat > request.json << 'EOF' { "inputAttachments": [ { "key": "my-input", "input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " } ], "output": { "uri": "gs://BUCKET_NAME " }, "elementaryStreams": [ { "key": "es_video", "videoStream": { "h264": { "profile": "high", "widthPixels": 1280, "heightPixels": 720, "bitrateBps": 3000000, "frameRate": 30 } } }, { "key": "es_audio", "audioStream": { "codec": "aac", "channelCount": 2, "bitrateBps": 160000 } } ], "muxStreams": [ { "key": "mux_video_ts", "container": "ts", "elementaryStreams": ["es_video", "es_audio"], "segmentSettings": { "segmentDuration": "2s" } } ], "manifests": [ { "key": "manifest_hls", "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts" ], "maxSegmentCount": 5 } ] } EOF
Then execute the following command to send your REST request:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels?channelId=CHANNEL_ID "
PowerShell (Windows)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
@' { "inputAttachments": [ { "key": "my-input", "input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " } ], "output": { "uri": "gs://BUCKET_NAME " }, "elementaryStreams": [ { "key": "es_video", "videoStream": { "h264": { "profile": "high", "widthPixels": 1280, "heightPixels": 720, "bitrateBps": 3000000, "frameRate": 30 } } }, { "key": "es_audio", "audioStream": { "codec": "aac", "channelCount": 2, "bitrateBps": 160000 } } ], "muxStreams": [ { "key": "mux_video_ts", "container": "ts", "elementaryStreams": ["es_video", "es_audio"], "segmentSettings": { "segmentDuration": "2s" } } ], "manifests": [ { "key": "manifest_hls", "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts" ], "maxSegmentCount": 5 } ] } '@ | Out-File -FilePath request.json -Encoding utf8
Then execute the following command to send your REST request:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels?channelId=CHANNEL_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "verb": "create", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Get channel details
To get the details of the channel, use the
projects.locations.channels.get
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your channel is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the channelCHANNEL_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID "
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "inputAttachments": [ { "key": "INPUT_ID ", "input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " } ], "activeInput": "INPUT_ID ", "output": { "uri": "gs://BUCKET_NAME " }, "elementaryStreams": [ { "videoStream": { "h264": { "widthPixels": 1280, "heightPixels": 720, "frameRate": 30, "bitrateBps": 3000000, "gopDuration": "2s", "vbvSizeBits": 3000000, "vbvFullnessBits": 2700000, "entropyCoder": "cabac", "profile": "high" } }, "key": "es_video" }, { "audioStream": { "codec": "aac", "bitrateBps": 160000, "channelCount": 2, "channelLayout": ["fl", "fr"], "sampleRateHertz": 48000 }, "key": "es_audio" } ], "muxStreams": [ { "key": "mux_video_ts", "container": "ts", "elementaryStreams": ["es_video", "es_audio"], "segmentSettings": { "segmentDuration": "2s" } } ], "manifests": [ { "key": "manifest_hls", "fileName": "main.m3u8", "type": "HLS", "muxStreams": [ "mux_video_ts", ], "maxSegmentCount": 5, "segmentKeepDuration": "60s" } ], "streamingState": "STOPPED" }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Update a channel
To update a channel, use the
projects.locations.channels.patch
method.
The following example updates the input endpoint used by the channel. Not all fields can be updated; see the list of supported fields.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location of the channel; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: the user-defined identifier for the channel to updateCHANNEL_ID
: the user-defined identifier for the new input endpoint to useINPUT_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
cat > request.json << 'EOF' { "inputAttachments": [ { "key": "input-primary", "input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " } ] } EOF
Then execute the following command to send your REST request:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ?updateMask=input_attachments"
PowerShell (Windows)
Save the request body in a file named request.json
.
Run the following command in the terminal to create or overwrite
this file in the current directory:
@' { "inputAttachments": [ { "key": "input-primary", "input": "projects/PROJECT_NUMBER /locations/LOCATION /inputs/INPUT_ID " } ] } '@ | Out-File -FilePath request.json -Encoding utf8
Then execute the following command to send your REST request:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ?updateMask=input_attachments" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "verb": "update", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Start or stop a channel
Use the following methods to start or stop a channel. The server creates a part
of the video pipeline when the channels.start
request is received. The server
releases a part of the video pipeline when the channels.stop
request is
received.
Start a channel
To start a channel, use the
projects.locations.channels.start
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your channel is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the channelCHANNEL_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :start"
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :start" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "verb": "start", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Stop a channel
To stop a channel, use the
projects.locations.channels.stop
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your channel is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the channelCHANNEL_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X POST \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d "" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop"
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method POST `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID :stop" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "verb": "stop", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
List channels
To list all of the channels you created in a location, use the
projects.locations.channels.list
method.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your channel is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X GET \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels"
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method GET `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "channels": [ { "name": "projects/PROJECT_NUMBER /locations/LOCATION /channels/my-channel ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "activeInput": "INPUT_ID ", "output": { "uri": "gs://BUCKET_NAME " }, ... }, { "name": "projects/PROJECT_NUMBER /locations/LOCATION /channels/my-channel2 ", "createTime":CREATE_TIME , "updateTime":UPDATE_TIME , "activeInput": "my-other-input ", "output": { "uri": "gs://BUCKET_NAME " }, ... } ] }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
Delete a channel
To delete a channel, use the
projects.locations.channels.delete
method. You must stop the channel and
delete all channel events
before you can delete the channel.
Before using any of the request data, make the following replacements:
: your Google Cloud project number; this is located in the Project number field on the IAM Settings pagePROJECT_NUMBER
: the location where your channel is located; use one of the supported regionsLOCATION Show locationsus-central1
us-east1
us-east4
us-west1
us-west2
northamerica-northeast1
southamerica-east1
asia-east1
asia-east2
asia-south1
asia-northeast1
asia-southeast1
australia-southeast1
europe-north1
europe-west1
europe-west2
europe-west3
europe-west4
: a user-defined identifier for the channelCHANNEL_ID
To send your request, expand one of these options:
curl (Linux, macOS, or Cloud Shell)
Execute the following command:
curl -X DELETE \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
"https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID "
PowerShell (Windows)
Execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method DELETE `
-Headers $headers `
-Uri "https://livestream.googleapis.com/v1/projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID " | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER /locations/LOCATION /operations/OPERATION_ID ", "metadata": { "@type": "type.googleapis.com/google.cloud.video.livestream.v1.OperationMetadata", "createTime":CREATE_TIME , "target": "projects/PROJECT_NUMBER /locations/LOCATION /channels/CHANNEL_ID ", "verb": "delete", "requestedCancellation": false, "apiVersion": "v1" }, "done": false }
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API C# API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Go API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Java API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Node.js API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API PHP API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Python API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
To learn how to install and use the client library for Live Stream API, see Live Stream API client libraries. For more information, see the Live Stream API Ruby API reference documentation.
To authenticate to Live Stream API, set up Application Default Credentials. For more information, see Set up authentication for a local development environment.
What's next
Learn how to create and manage channel events.