All Products
Search
Document Center

ApsaraVideo Live:SetLiveEdgeTransfer

Last Updated:Dec 12, 2024

Sets the configuration of edge stream relay.

Operation description

You can call the SetLiveEdgeTransfer operation to configure edge stream relay. The configuration takes effect for ingested streams that start after edge stream relay is configured. The following table describes the scenarios in which edge stream relay takes effect or not.

ScenarioAnalysisResult
1. You ingest a stream before you call the SetLiveEdgeTransfer operation.The configuration of edge stream relay is not available.The ingested stream is not affected by your call of the SetLiveEdgeTransfer operation. Edge 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 stream relay is available.Edge 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 stream relay is available.Edge stream relay takes effect for the ingested stream based on the configuration.

QPS limit

You can call this 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.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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.
OperationAccess levelResource typeCondition keyAssociated operation
live:SetLiveEdgeTransferupdate
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DomainNamestringYes

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
AppNamestringNo

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 about the AppName and StreamName parameters section. For example, a value of liveApp****[1,2,3] specifies that stream relay is configured for three applications: liveApp****1, liveApp****2, and liveApp****3.****

Note
  • This parameter takes effect for only destination domain names that are specified by the TargetDomainList parameter.

  • You cannot use a caret (^) or a dollar sign ($) in a regular expression to configure the AppName parameter. Otherwise, stream relay fails.

liveApp****
StreamNamestringNo

The name of the ingested stream. Regular expressions are supported, with a few limits. For more information, see the Description about the AppName and StreamName parameters section. For example, a value of liveStream****[1,2,3] specifies that stream relay is configured for three streams: liveStream****1, liveStream****2, and liveStream****3.****

Note
  • This parameter takes effect for only destination domain names that are specified by the TargetDomainList parameter.

  • You cannot use a caret (^) or a dollar sign ($) in a regular expression to configure the StreamName parameter. Otherwise, stream relay fails.

liveStream****
TargetDomainListstringNo

The destination domain names to which you want to relay the ingested stream. Separate multiple domain names with commas (,). The request must contain the TargetDomainList parameter or the HttpDns parameter. The two parameters are mutually exclusive.

Note
  • The AppName and StreamName parameters take effect only when the TargetDomainList parameter is configured.

  • If the TargetDomainList parameter is configured, you cannot configure the HttpDns parameter.

learn.aliyundoc.com,guide.aliyundoc.com
HttpDnsstringNo

The HTTPDNS API that is used to obtain the destination URLs. The request must contain the TargetDomainList parameter or the HttpDns parameter. The two parameters are mutually exclusive.

Note If the HttpDns 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 the Description about the HTTPDNS API section.

http://developer.aliyundoc.com
TransferArgsstringNo

Specifies whether to pass through stream ingest parameters. Valid values:

  • yes: passes through stream ingest parameters.
  • no: does not pass through stream ingest parameters.
yes

Description about 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 about 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={}&app={}&name={}{<_ali_user_args>}
Note: When the HTTPDNS API is accessed, the following parameters are replaced with the actual values 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****"
        }
    ]
}
ParameterDescriptionExample
nameThe name of the CDN point of presence (POP). You can specify a custom name. Duplicate names are not allowed.cdnA****
upstream_urlThe destination URL to which the ingested stream is relayed.rtmp://developer.aliyundoc.com/live/testedge****

Note You can obtain the destination domain name from the JSON-formatted result. If multiple destination domain names are obtained, the ingested stream is relayed to multiple domain names.

  • If the structure of the returned data does not meet the requirements, stream relay fails.

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CF8

Examples

Sample success responses

JSONformat

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CF8"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParamParameter invalid.Illegal input parameters
500InternalErrorThe request processing has failed due to backend service exception.-

For a list of error codes, visit the Service error codes.