Calls SetLiveEdgeTransfer to configure live stream relay settings.
Operation description
The live edge stream relay configuration made by calling SetLiveEdgeTransfer only takes effect for streams that start after the configuration is completed. The following are examples of some typical scenarios:
| Scenario | Analysis | Result |
| 1. The user has already started streaming before calling SetLiveEdgeTransfer. | The live edge stream relay configuration does not exist at this point. | The stream is not affected by the SetLiveEdgeTransfer configuration, meaning live edge stream relay will not be initiated. |
| 2. The user interrupts streaming that was started before calling SetLiveEdgeTransfer, and then resumes streaming. | The live edge stream relay configuration already exists at this point. | The resumed stream will initiate live stream relay according to the SetLiveEdgeTransfer configuration. |
| 3. The user starts streaming after calling SetLiveEdgeTransfer. | The live edge stream relay configuration already exists at this point. | This stream will initiate live stream relay according to the SetLiveEdgeTransfer configuration. |
QPS Limit
The single-user QPS limit for this API is 100 calls/second. Exceeding the limit will result in API throttling, which may affect your business. Please call this API appropriately.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
live:SetLiveEdgeTransfer |
update |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
No |
The region ID. |
cn-shanghai |
| DomainName |
string |
Yes |
The ingest domain name. Live stream relay is configured at the granularity of the ingest DomainName. Each domain can have only one live stream relay configuration. |
demo.aliyundoc.com |
| AppName |
string |
No |
The application name to which the live stream belongs. Regular expressions are supported for configuration with exceptions. For more information, see AppName and StreamName Parameter Configuration Instructions below. For example: liveApp****[1,2,3] indicates that the three apps liveApp1, liveApp2, and liveApp****3 are allowed for stream relay. Note
|
liveApp**** |
| StreamName |
string |
No |
The stream name. Regular expressions are supported for configuration with exceptions. For more information, see AppName and StreamName Parameter Configuration Instructions below. For example: liveStream****[1,2,3] indicates that the three streams liveStream1, liveStream2, and liveStream****3 are allowed for stream relay. Note
|
liveStream**** |
| TargetDomainList |
string |
No |
The list of target domains specified by the user for stream relay. Multiple domains are separated by commas (,). The request must contain one of the Note
|
learn.aliyundoc.com,guide.aliyundoc.com |
| HttpDns |
string |
No |
The HTTPDNS interface for obtaining the stream relay target address. The request must contain one of the Note
If Live stream relay has requirements for the message structure returned by the HTTPDNS interface. For more information, see HTTPDNS Instructions below. |
http://developer.aliyundoc.com |
| TransferArgs |
string |
No |
Specifies whether to pass through ingest parameters. Valid values:
Valid values:
|
yes |
AppName and StreamName Parameter Configuration Instructions
Neither AppName nor StreamName supports ^ or $ matching. If either value contains ^ or $, stream relay will fail.
HTTPDNS Instructions
If HttpDns is set in the request parameters of SetLiveEdgeTransfer, live stream relay will access the HTTPDNS interface set through HttpDns to obtain the stream relay target address.
Request example:
http://developer.aliyundoc.com/?host={
{
}: The ingest domain name. {
}: The application name to which the live stream belongs. {
}: The stream name. {<_ali_user_args>}: The parameters carried by the user's ingest stream.
The requirements for the interface return code and return data for live stream relay are as follows:
A return code of 403 indicates access failure, and stream relay is not required.
A return code of 200 indicates successful access, and the result is returned in JSON format. The structure and parameter examples are as follows:
{
"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 CDN name. It can be customized but must not be duplicated. | cdnA**** |
| upstream_url | The ingest address to relay to. | rtmp://developer.aliyundoc.com/live/testedge**** |
The relay domains are obtained from the returned JSON result. If multiple relay domains are returned, it means the original stream needs to be pushed to multiple destinations.
If the returned data structure does not meet the requirements, stream relay will fail.
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
16A96B9A-F203-4EC5-8E43-CB92E68F4CF8 |
Examples
Success response
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. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.