Sets the configurations of live stream transfer for an ingest domain.

The configurations are only applicable to the streams that are pushed after setting the configurations. The following are some typical scenarios:

Scenario Reasoning Result
The user pushed a stream before setting the configurations using this API. The configuration does not exist for the stream being pushed. The configuration is not applied to the stream being pushed.
The user pushed a stream before setting configurations using this API. After the configuration, the user stops pushing the stream for a while and restarts pushing it. The configuration exists after the stream pushing is restarted. The configuration is applied to the stream being pushed again.
The user pushes a steam after setting configurations using this API. The configuration exists for the stream being pushed. The configuration is applied to the stream being pushed.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes SetLiveEdgeTransfer

The operation that you want to perform. Set the value to SetLiveEdgeTransfer.

DomainName String Yes push.****.alivecdn.com

The ingest domain.

RegionId String No cn-shanghai

The ID of the region where the ingest domain resides.

AppName String No testApp

The name of the application to which one or more live streams to be pushed belong. This parameter takes effect only if the TargetDomainList parameter is set. You can specify a regular expression. For example, test[1,2,3] indicates that the configuration is applicable to streams of the applications named test1, test2, and test3.

Notice Do not include ^ or $ in the regular expression. Otherwise, the stream cannot be transferred using the configuration.
StreamName String No testStream

The name of the ingested stream to be pushed. This parameter takes effect only if the TargetDomainList parameter is set. You can specify a regular expression. For example, streamtest[1,2,3] indicates that the configuration is applicable to the streams named streamtest1, streamtest2, and streamtest3.

Notice Do not include ^ or $ in the regular expression. Otherwise, the stream cannot be transferred using the configuration.
TargetDomainList String No push.example1.com,push.example2.com

The destination domain names to which you want to push ingested streams. Separate multiple domain names with commas (,).

Note Specify only one of the HttpDns and TargetDomainList parameters.
HttpDns String No http://example.httpdns.com

The HTTPDNS interface that is used to obtain the destination domain names. For more information, see the "HTTPDNS" section in this topic.

Note Specifies only one of the HttpDns and TargetDomainList parameters. If HttpDns is specified, the AppName and StreamName parameters do not take effect.
TransferArgs String No Yes

Specifies whether to enable pass-through for parameters related to ingested streams. Valid values:

  • yes: enables pass-through.
  • no: disables pass-through.

HTTPDNS

The HTTPDNS interface specified in the HttpDns parameter is used to obtain the destination domain names for live stream transfer. The following is an example request to the HTTPDNS interface:

http://example.httpdns.com/?host={<host>}&app={<app>}&name={<name>}{<_ali_user_args>}

The variables in the request are replaced by information in the URL of the ingested stream:

  • {<host>}: the ingest domain.
  • {<app>}&: the name of the application to which the stream belongs.
  • {<name>}: the name of the stream.
  • {<_ali_user_args>}: the parameters set when the stream is pushed.

The requirements for the return code and return result are as follows:

  • Return code 403 indicates that the access fails and the ingested streams cannot be pushed.
  • Return code 200 indicates that the access succeeds and the destination domain names can be obtained from the return result in JSON format. The following example shows the return result:

{
    "cdn_types": [
        {
            "name": "cdnA",
            "upstream_url": "rtmp://cdna.example.com/live/testedge"
        },
        {
            "name": "cdnB",
            "upstream_url": "rtmp://cdnb.example.com/live/testedge"
        }
    ]
}
            
  • name: the name of the content delivery network (CDN) node. You can customize a unique name.
  • upstream_url: the destination domain name to which you want to push ingested streams.
Note
  • If multiple destination domain names are returned, ingested streams are pushed to multiple domain names.
  • If the return result does not meet the requirements, the live transfer may fail.

Response parameters

Parameter Type Example Description
RequestId String 16A96B9A-F203-4EC5-8E43-CB92E68F4CF8

The ID of the request.

Examples

Sample requests

http(s)://live.aliyuncs.com/?Action=SetLiveEdgeTransfer
&DomainName=push.****.alivecdn.com
&<Common request parameters>

Sample success responses

XML format

<SetLiveEdgeTransferResponse>
  <RequestId>16A96B9A-F203-4EC5-8E43-CB92E68F4CF8</RequestId>
</SetLiveEdgeTransferResponse>

JSON format

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

Error codes

For a list of error codes, visit the API Error Center.