功能描述
更新媒体处理队列。
推荐使用 API Explorer
点击调试
API Explorer 提供了在线调用、签名验证、SDK 代码生成和快速检索接口等能力。您可查看每次调用的请求内容和返回结果以及自动生成 SDK 调用示例。
请求
请求示例
PUT /queue/<queueId> HTTP/1.1
Host: <BucketName-APPID>.ci.<Region>.myqcloud.com
Date: <GMT Date>
Authorization: <Auth String>
Content-Length: <length>
Content-Type: application/xml
<body>
说明:
请求头
此接口仅使用公共请求头部,详情请参见 公共请求头部 文档。
请求体
该请求操作的实现需要有以下请求体。
<Request>
<Name>My-Queue-Media</Name>
<State>Active</State>
<NotifyConfig>
<State>On</State>
<Url>http://callback.demo.com</Url>
<Type>Url</Type>
<Event>TaskFinish,WorkflowFinish</Event>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
</Request>
具体的数据内容如下:
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 | 默认值 | 限制 |
---|---|---|---|---|---|---|
Request | 无 | 保存结果的容器。 | Container | 是 | 无 | 无 |
Container 节点 Request 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 | 默认值 | 限制 |
---|---|---|---|---|---|---|
Name | Request | 队列名称,长度不超过128 | String | 是 | 无 | 无 |
State | Request | 1. Active 表示队列内的作业会被媒体处理服务调度执行 2. Paused 表示队列暂停,作业不再会被媒体处理调度执行,队列内的所有作业状态维持在暂停状态,已经执行中的任务不受影响 |
String | 是 | 无 | 无 |
NotifyConfig | Request | 回调配置 | Container | 是 | 无 | 无 |
Container 节点 NotifyConfig 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 | 是否必选 | 默认值 | 限制 |
---|---|---|---|---|---|---|
State | Request.NotifyConfig | 回调开关,Off/On | String | 否 | Off | On/Off |
Event | Request.NotifyConfig | 回调事件 | String | 当 State=On 时, 必选 | 无 | 任务完成:TaskFinish;工作流完成:WorkflowFinish |
ResultFormat | Request.NotifyConfig | 回调格式 | String | 否 | XML | JSON/XML |
Type | Request.NotifyConfig | 回调类型 | String | 当 State=On 时, 必选 | 无 | Url 或 TDMQ |
Url | Request.NotifyConfig | 回调地址 | String | 当 State=On, 且 Type=Url 时, 必选 | 无 | 不能为内网地址 |
MqMode | Request.NotifyConfig | TDMQ 使用模式 | String | 当 State=On, 且 Type=TDMQ 时, 必选 | Queue | 主题订阅:Topic 队列服务: Queue |
MqRegion | Request.NotifyConfig | TDMQ 所属园区 | String | 当 State=On, 且 Type=TDMQ 时, 必选 | 无 | 目前支持园区 sh(上海)、bj(北京)、gz(广州)、cd(成都)、hk(香港) |
MqName | Request.NotifyConfig | TDMQ 主题名称 | String | 当 State=On, 且 Type=TDMQ 时, 必选 | 无 | 无 |
响应
响应头
此接口仅返回公共响应头部,详情请参见 公共响应头部 文档。
响应体
该响应体返回为 application/xml 数据,包含完整节点数据的内容展示如下:
<Response>
<RequestId>NjJmNDczY2RfOTBmYTUwNjRfNTA4ZV85</RequestId>
<Queue>
<QueueId>p4a17eeea29334bf499b7e20e2fbfd99d</QueueId>
<Name>My-Queue-Media</Name>
<State>Active</State>
<NotifyConfig>
<Url>http://callback.demo.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<State>On</State>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<UpdateTime>2022-08-09T16:23:11+0800</UpdateTime>
<CreateTime>2022-08-09T16:13:05+0800</CreateTime>
</Queue>
</Response>
具体的数据内容如下:
节点名称(关键字) | 父节点 | 描述 | 类型 |
---|---|---|---|
Response | 无 | 保存结果的容器 | Container |
Container 节点 Response 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
---|---|---|---|
RequestId | Response | 请求的唯一 ID | String |
Queue | Response | 队列信息 | Container |
Container 节点 Queue 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
---|---|---|---|
QueueId | Response.Queue | 队列 ID | String |
Name | Response.Queue | 队列名字 | String |
State | Response.Queue | 当前状态,Active 或者 Paused | String |
NotifyConfig | Response.Queue | 回调配置,同 Request.NotifyConfig | Container |
MaxSize | Response.Queue | 队列最大长度 | Int |
MaxConcurrent | Response.Queue | 当前队列最大并行执行的任务数 | Int |
Category | Response.Queue | 队列类型 | String |
UpdateTime | Response.Queue | 更新时间 | String |
CreateTime | Response.Queue | 创建时间 | String |
错误码
该请求操作无特殊错误信息,常见的错误信息请参见 错误码 文档。
实际案例
请求
PUT /queue/p4a17eeea29334bf499b7e20e2fbfd99d HTTP/1.1
Authorization: q-sign-algorithm=sha1&q-ak=AKIDZfbOAo7cllgPvF9cXFrJD0a1ICvR****&q-sign-time=1497530202;1497610202&q-key-time=1497530202;1497610202&q-header-list=&q-url-param-list=&q-signature=28e9a4986df11bed0255e97ff90500557e0e****
Host: test-1234567890.ci.ap-chongqing.myqcloud.com
Content-Length: 162
Content-Type: application/xml
<Request>
<Name>My-Queue-Media</Name>
<State>Active</State>
<NotifyConfig>
<State>On</State>
<Url>http://callback.demo.com</Url>
<Type>Url</Type>
<Event>TaskFinish,WorkflowFinish</Event>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
</Request>
响应
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 100
Connection: keep-alive
Date: Thu, 09 Aug 2022 16:23:12 GMT
Server: tencent-ci
x-ci-request-id: NjJmNDczY2RfOTBmYTUwNjRfNTA4ZV85
<Response>
<RequestId>NjJmNDczY2RfOTBmYTUwNjRfNTA4ZV85</RequestId>
<Queue>
<QueueId>p4a17eeea29334bf499b7e20e2fbfd99d</QueueId>
<Name>My-Queue-Media</Name>
<State>Active</State>
<NotifyConfig>
<Url>http://callback.demo.com</Url>
<Event>TaskFinish,WorkflowFinish</Event>
<Type>Url</Type>
<State>On</State>
<ResultFormat>JSON</ResultFormat>
</NotifyConfig>
<UpdateTime>2022-08-09T16:23:11+0800</UpdateTime>
<CreateTime>2022-08-09T16:13:05+0800</CreateTime>
</Queue>
</Response>