Sets the configuration of edge node stream relay.
Operation description
You can call the SetLiveEdgeTransfer operation to configure edge node stream relay. The configuration takes effect for ingested streams that start after edge node stream relay is configured. The following table describes the scenarios in which edge node stream relay takes effect or not.
Scenario | Analysis | Result |
---|---|---|
1. You ingest a stream before you call the SetLiveEdgeTransfer operation. | The configuration of edge node stream relay is not available. | The ingested stream is not affected by your call of the SetLiveEdgeTransfer operation. Edge node stream relay does not take effect. |
2. You disconnect an ingested stream that started before you called the SetLiveEdgeTransfer operation, and then resume the ingested stream. | The configuration of edge node stream relay is available. | Edge node stream relay takes effect for the resumed ingested stream based on the configuration. |
3. You ingest a stream after you call the SetLiveEdgeTransfer operation. | The configuration of edge node stream relay is available. | Edge node stream relay takes effect for the ingested stream based on the configuration. |
QPS limit
You can call this API operation up to 100 times per second per account. Requests that exceed this limit are dropped and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limit on an API operation in ApsaraVideo Live.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
live:SetLiveEdgeTransfer | update | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DomainName | string | Yes | The ingest domain. Stream relay is configured based on the ingest domain. Only one stream relay configuration can be set for an ingest domain. | demo.aliyundoc.com |
AppName | string | No | The name of the application to which the live stream belongs. Regular expressions are supported, with a few limits. For more information, see the Description of the AppName and StreamName parameters section. For example, liveApp****1,2,3 specifies that stream relay is configured for three applications: liveApp ****1, liveApp ****2, and liveApp ****3. Note
| liveApp**** |
StreamName | string | No | The name of the ingested stream. Regular expressions are supported, with a few limits. For more information, see the Description of the AppName and StreamName parameters section. For example, liveStream****1,2,3 specifies that stream relay is configured for three streams: liveStream ****1, liveStream ****2, and liveStream ****3. Note
| liveStream**** |
TargetDomainList | string | No | The destination domain names to which you want to relay the ingested stream. Separate multiple domain names with commas (,). The request must contain the Note
| learn.aliyundoc.com,guide.aliyundoc.com |
HttpDns | string | No | The HTTPDNS API that is used to obtain the destination URLs. The request must contain the Note
If the HttpsDns parameter is configured, you cannot configure the TargetDomainList parameter, and the AppName and StreamName parameters do not take effect.
For information about the requirements on the structure of messages that are returned by the HTTPDNS API, see Description of the HTTPDNS API section. | http://developer.aliyundoc.com |
TransferArgs | string | No | Specifies whether to enable pass-through for parameters in the ingest URL. Valid values:
| yes |
Description of the AppName and StreamName parameters
The AppName and StreamName parameters do not support carets (^
) and dollar signs ($
). If a caret (^
) or a dollar sign ($
) exists in the parameter values, stream relay fails.
Description of the HTTPDNS API
If the HttpDns
parameter is configured, the destination domain names are obtained by accessing the HTTPDNS API that is specified by the HttpDns
parameter.
Example:
http://developer.aliyundoc.com/?host={
Note: When the HTTPDNS API is accessed, the following parameters are replaced with the information in the ingest URL.
- {
}: The ingest domain. - {
}: The name of the application to which the live stream belongs. - {
}: The name of the stream. - {<_ali_user_args>}: The custom parameters that are carried in the ingest URL.
The following HTTP status codes and results are returned.
- If HTTP status code 403 is returned, the access to the HTTPDNS API fails. Stream relay is not required.
- If HTTP status code 200 is returned, the access to the HTTPDNS API is successful. The returned result is in the JSON format. The following sample code provides an example of the message structure and parameters.
{
"cdn_types": [
{
"name": "cdnA****",
"upstream_url": "rtmp://developer.aliyundoc.com/live/testedge****"
},
{
"name": "cdnB****",
"upstream_url": "rtmp://developer.aliyundoc.com/live/testedge****"
}
]
}
Parameter | Description | Example |
---|---|---|
name | The name of the CDN node. You can specify a custom name. Duplicate names are not allowed. | cdnA**** |
upstream_url | The destination URL to which the ingested stream is relayed. | rtmp://developer.aliyundoc.com/live/testedge**** |
- If the structure of the returned data does not meet the requirements, stream relay fails.
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CF8"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidParam | Parameter invalid. | Illegal input parameters |
500 | InternalError | The request processing has failed due to backend service exception. | - |
For a list of error codes, visit the Service error codes.