All Products
Search
Document Center

ApsaraVideo Live:SetLiveEdgeTransfer

更新時間:Jul 23, 2024

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 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 limits.

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 demo.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.

AppName String No liveApp****

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

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.
StreamName String No liveStream****

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

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.
TargetDomainList String No learn.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 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.
HttpDns String No http://developer.aliyundoc.com

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.

TransferArgs String No yes

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

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

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

Note: When the HTTPDNS API is accessed, the following parameters are replaced with the actual values 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 point of presence (POP). 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

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

The request ID.

Examples

Sample requests

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, see Service error codes.