tencent cloud

文档反馈

更新队列

最后更新时间:2024-01-20 09:22:44

    功能描述

    更新 AI 内容识别队列。
    

    请求

    请求示例

    PUT /ai_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>
    说明:
    Authorization: Auth String(详情请参见 请求签名 文档)。
    通过子账号使用时,需要授予相关的权限,详情请参见 授权粒度详情 文档。

    请求头

    此接口仅使用公共请求头部,详情请参见 公共请求头部 文档。

    请求体

    该请求操作的实现需要有以下请求体。
    <Request>
    <Name>My-Queue-AI</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>p23f69f4779e64b18aa61e70d5416c071</QueueId>
    <Name>My-Queue-AI</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 /ai_queue/p23f69f4779e64b18aa61e70d5416c071 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-AI</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>p23f69f4779e64b18aa61e70d5416c071</QueueId>
    <Name>My-Queue-AI</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>