全部产品
Search
文档中心

对象存储 OSS:PutLiveChannelStatus

更新时间:Apr 27, 2025

LiveChannel分为启用(enabled)和禁用(disabled)两种状态。您可以使用PutLiveChannelStatus接口在两种状态之间进行切换。

注意事项

LiveChannel有如下注意事项:

  • LiveChannel处于disabled状态时,OSS会禁止您向该LiveChannel进行推流操作。如果您正在向该LiveChannel推流,那么推流的客户端会被强制断开(会有10s左右的延迟)。

  • 当没有客户端向该LiveChannel推流时,调用PutLiveChannel重新创建LiveChannel也可以达到修改Status的目的。

  • 当有客户端向该LiveChannel推流时,只能将LiveChannel的状态修改为disabled,无法调用PutLiveChannelStatus重新创建LiveChannel。

权限说明

阿里云账号默认拥有全部权限。阿里云账号下的RAM用户或RAM角色默认没有任何权限,需要阿里云账号或账号管理员通过RAM PolicyBucket Policy授予操作权限。

API

Action

说明

PutLiveChannelStatus

oss:PutLiveChannelStatus

在启用(enabled)和禁用(disabled)两种状态之间进行切换。

请求语法

PUT /ChannelName?live&status=NewStatus HTTP/1.1
Date: Tue, 25 Dec 2018 17:35:24 GMT
Host: BucketName.oss-cn-hangzhou.aliyuncs.com
Authorization: SignatureValue

请求元素

名称

类型

是否必选

描述

status

字符串

设置LiveChannel的Status。

有效值:

  • enabled:启用LiveChannel

  • disabled:禁用LiveChannel

请求头

此接口仅涉及公共请求头,请参见公共请求头(Common Request Headers)

响应头

此接口仅涉及公共响应头,详情请参见公共响应头(Common Response Headers)

示例

请求示例

PUT /test-channel?live&status=disabled HTTP/1.1
Date: Tue, 25 Dec 2018 17:35:24 GMT
Host: test-bucket.oss-cn-hangzhou.aliyuncs.com
Authorization: OSS4-HMAC-SHA256 Credential=LTAI********************/20250417/cn-hangzhou/oss/aliyun_v4_request,Signature=a7c3554c729d71929e0b84489addee6b2e8d5cb48595adfc51868c299c0c218e

返回示例

HTTP/1.1 200
Content-Length: 0
Server: AliyunOSS
Connection: close
x-oss-request-id: 57BE8422B92475920B00****
Date: Tue, 25 Dec 2018 17:35:24 GMT