Sets the configuration of edge node stream relay.

Usage notes

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

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

ParameterTypeRequiredExampleDescription
ActionStringYesSetLiveEdgeTransfer

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

DomainNameStringYesdemo.aliyundoc.com

The ingest domain. Stream relay is configured based on the ingest domain. Only one stream relay configuration can be set for an ingest domain.

AppNameStringNoliveApp****

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, liveApp1,2,3 specifies that stream relay is configured for three applications: liveApp 1, liveApp 2, and liveApp 3.

Note
  • This parameter takes effect only for 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.
StreamNameStringNoliveStream****

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, liveStream1,2,3 specifies that stream relay is configured for three streams: liveStream 1, liveStream 2, and liveStream 3.

Note
  • This parameter takes effect only for 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.
TargetDomainListStringNolearn.aliyundoc.com,guide.aliyundoc.com

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 HttpsDns 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 HttpsDns parameter.
HttpDnsStringNohttp://developer.aliyundoc.com

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

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.

TransferArgsStringNoyes

Specifies whether to enable pass-through for parameters in the ingest URL. Valid values:

  • yes: enables pass-through.
  • no: disables pass-through. This is the default value.

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={<host>}&app={<app>}&name={<name>}{<_ali_user_args>}

Note: When the HTTPDNS API is accessed, the following parameters are replaced with the information in the ingest URL.

  • {<host>}: The ingest domain.
  • {<app>}: The name of the application to which the live stream belongs.
  • {<name>}: 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****

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

ParameterTypeExampleDescription
RequestIdString16A96B9A-F203-4EC5-8E43-CB92E68F4CF8

The ID of the request.

Examples

Sample request

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

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

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

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