diff options
Diffstat (limited to 'data/zh_cn/smqproxy')
| -rw-r--r-- | data/zh_cn/smqproxy/2026-04-09/api-docs.php | 756 |
1 files changed, 756 insertions, 0 deletions
diff --git a/data/zh_cn/smqproxy/2026-04-09/api-docs.php b/data/zh_cn/smqproxy/2026-04-09/api-docs.php new file mode 100644 index 0000000..faa11d1 --- /dev/null +++ b/data/zh_cn/smqproxy/2026-04-09/api-docs.php @@ -0,0 +1,756 @@ +<?php return [ + 'version' => '1.0', + 'info' => ['product' => 'SMQProxy', 'version' => '2026-04-09'], + 'directories' => [ + [ + 'children' => ['PublishMessage'], + 'type' => 'directory', + 'title' => '主题', + 'id' => 455559, + ], + [ + 'children' => ['BatchDeleteMessage', 'BatchPeekMessage', 'BatchReceiveMessage', 'BatchSendMessage', 'ChangeMessageVisibility', 'DeleteMessage', 'PeekMessage', 'ReceiveMessage', 'SendMessage'], + 'type' => 'directory', + 'title' => '队列', + 'id' => 455561, + ], + ], + 'components' => [ + 'schemas' => [], + ], + 'apis' => [ + 'BatchDeleteMessage' => [ + 'path' => '/queues/{queueName}/messages', + 'methods' => ['delete'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称。', 'type' => 'string', 'required' => false, 'example' => 'test-queue'], + ], + [ + 'name' => 'body', + 'in' => 'body', + 'style' => 'json', + 'schema' => [ + 'description' => '请求Body。', + 'type' => 'object', + 'properties' => [ + 'ReceiptHandles' => [ + 'description' => '多条消息的ReceiptHandle', + 'type' => 'array', + 'items' => ['description' => '消息的ReceiptHandle', 'type' => 'string', 'required' => false, 'example' => '1-ODU4OTkzNDU5My0xNDM'], + 'required' => false, + ], + ], + 'required' => false, + ], + ], + ], + 'responses' => [ + 204 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [], + 'description' => '', + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '批量删除消息', + 'summary' => '批量删除队列中的消息,最多可删除16条。', + 'description' => '## 请求说明'."\n" + ."\n" + .'- 建议与 BatchReceiveMessage 搭配使用。'."\n" + .'- 批量操作的结果可能同时包含成功和失败的子请求。只有全部成功时 HTTP 状态码才是 204。'."\n" + .'- 每次请求最多可以删除 16 条消息。'."\n" + .'- 需要提供上次消费返回的 `ReceiptHandle` 列表来定位要删除的消息。'."\n" + .'- 本操作只有在 `NextVisibleTime` 之前执行才能成功。超时后消息重新变为 Active 状态,ReceiptHandle 失效,需重新消费获取新句柄。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{}","type":"json"}]', + ], + 'BatchPeekMessage' => [ + 'summary' => '批量查看队列中的消息,不改变消息状态。', + 'path' => '/queues/{queueName}/messages', + 'methods' => ['get'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'read', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称。', 'type' => 'string', 'required' => false, 'example' => 'test-queue'], + ], + [ + 'name' => 'peekonly', + 'in' => 'query', + 'schema' => ['title' => '表示这次请求只是去查看队列顶部的消息并不会引起消息的状态改变。取值固定为true。', 'description' => '表示这次请求只是去查看队列顶部的消息并不会引起消息的状态改变。取值固定为true。', 'type' => 'boolean', 'required' => false, 'default' => 'true'], + ], + [ + 'name' => 'numOfMessages', + 'in' => 'query', + 'schema' => ['title' => '本次BatchPeekMessage最多查看消息条数。', 'description' => '本次BatchPeekMessage最多查看消息条数。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '16'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => 'Schema of Response', + 'description' => 'Schema of Response', + 'type' => 'object', + 'properties' => [ + 'Messages' => [ + 'description' => '消息列表', + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['description' => '消息ID。', 'type' => 'string', 'example' => 'C0A80255D7D1163042EA3F2814D055F1'], + 'MessageBody' => ['description' => '消息体', 'type' => 'string', 'example' => 'This is a test message'], + 'MessageBodyMD5' => ['description' => '消息正文的MD5值', 'type' => 'string', 'example' => 'F9360F391579E71CA77BC5D50242****'], + 'EnqueueTime' => ['description' => '消息发送到队列的时间,取值为从1970年01月01日00:00:00 000开始的时间。', 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979248'], + 'FirstDequeueTime' => ['description' => '消息第一次被消费的时间,取值为从1970年01月01日00:00:00 000开始的毫秒数,如果DequeueCount为0,则与消息的EnqueueTime相同。', 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'DequeueCount' => ['description' => '总共被消费的次数。', 'type' => 'integer', 'format' => 'int64', 'example' => '5'], + 'Priority' => ['description' => '优先级,取值[1, 16],默认 8,1为 最高优先', 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'MessageGroupId' => ['description' => '消息分组 ID(仅 FIFO 队列)。', 'type' => 'string', 'example' => 'test-group'], + 'UserProperties' => [ + 'description' => '用户自定义属性(JSON 格式字符串)。', + 'type' => 'object', + 'example' => '{"properties1":"value"}', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + 'description' => '', + ], + ], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '批量查看消息', + 'description' => '## 请求说明'."\n" + .'- 该接口用于批量查看指定队列中的消息,一次最多可以查看16条消息。'."\n" + .'- 使用此接口不会改变消息的状态,消息仍保持为Active状态。'."\n" + .'- 不支持长轮询功能。'."\n" + .'- 需要提供`queueName`作为路径参数,并通过查询参数设置`peekonly=true`及指定要查看的消息数量`numOfMessages`(范围在1到16之间)。'."\n" + .'- 成功响应将返回一个包含所请求消息详细信息的数组,包括但不限于消息ID、正文、入队时间等。'."\n" + .'- 如果指定的队列不存在或队列中没有可见消息,则会返回相应的错误码。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Messages\\": [\\n {\\n \\"MessageId\\": \\"C0A80255D7D1163042EA3F2814D055F1\\",\\n \\"MessageBody\\": \\"This is a test message\\",\\n \\"MessageBodyMD5\\": \\"F9360F391579E71CA77BC5D50242****\\",\\n \\"EnqueueTime\\": 1250700979248,\\n \\"FirstDequeueTime\\": 1250700979348,\\n \\"DequeueCount\\": 5,\\n \\"Priority\\": 1,\\n \\"MessageGroupId\\": \\"test-group\\",\\n \\"UserProperties\\": {\\n \\"key\\": {\\n \\"DataType\\": \\"\\",\\n \\"StringValue\\": \\"\\",\\n \\"BinaryValue\\": \\"\\"\\n }\\n }\\n }\\n ]\\n}","type":"json"}]', + ], + 'BatchReceiveMessage' => [ + 'summary' => '从指定队列中批量获取最多16条消息进行消费。', + 'path' => '/queues/{queueName}/messages', + 'methods' => ['get'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'read', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'numOfMessages', + 'in' => 'query', + 'schema' => ['title' => '本次BatchReceiveMessage最多获取的消息条数。', 'description' => '本次最多获取的消息条数。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '10'], + ], + [ + 'name' => 'waitseconds', + 'in' => 'query', + 'schema' => ['title' => '本次BatchReceiveMessage请求最长的Polling等待时间,单位为秒。', 'description' => '本次请求最长的 Polling 等待时间(秒)。设为 0 表示立即返回。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '0'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => 'Schema of Response', + 'description' => '返回的消息列表'."\n", + 'type' => 'object', + 'properties' => [ + 'Messages' => [ + 'description' => '消息数组'."\n", + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['description' => '消息编号,在一个队列中唯一。'."\n", 'type' => 'string', 'example' => '5F290C926D472878214D9529A8FA200000001'], + 'ReceiptHandle' => ['description' => '本次获取消息产生的临时句柄,用于删除和修改 Inactive 状态消息,NextVisibleTime 之前有效。'."\n", 'type' => 'string', 'example' => '1-ODU4OTkzNDU5My0xNDMyNzI3ODI3LTItOA=='], + 'MessageBody' => ['description' => '消息正文。'."\n", 'type' => 'string', 'example' => 'This is test message 1.'], + 'MessageBodyMD5' => ['description' => '消息正文的 MD5 值。'."\n", 'type' => 'string', 'example' => 'C5DD56A39F5F7BB8B3337C6D11B6D8BE'], + 'EnqueueTime' => ['description' => '消息发送到队列的时间,从1970-01-01 00:00:00 000开始的毫秒数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'NextVisibleTime' => ['description' => '下次可被再次消费的时间(毫秒时间戳)。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'FirstDequeueTime' => ['description' => '首次被消费的时间(毫秒时间戳)。若 `DequeueCount=0` 则与 `EnqueueTime` 相同。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'DequeueCount' => ['description' => '总共被消费的次数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'Priority' => ['description' => '优先级,1 最高', 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'MessageGroupId' => ['description' => '消息分组 ID(仅 FIFO 队列)。', 'type' => 'string', 'example' => 'test-group'], + 'UserProperties' => [ + 'description' => '用户自定义属性(JSON 格式字符串)。', + 'type' => 'object', + 'example' => '{"properties1":"value"}', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + 'description' => '', + ], + ], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '批量消费消息', + 'description' => '## 请求说明'."\n" + ."\n" + .'- 该操作会将取得的消息状态变为 Inactive,Inactive 持续时间由队列属性 `VisibilityTimeout` 决定。'."\n" + .'- 消费者需在 VisibilityTimeout 时间内调用 DeleteMessage 删除消息,否则消息会重新变为 Active。'."\n" + .'- 支持长轮询(Long Polling):设置 `waitseconds > 0` 后,若队列为空则等待至有消息到达或超时返回。'."\n" + .'><notice>进入长轮询后,建议您降低外部调用长轮询的并发数,选择合适的长轮询时间。目前服务端会根据长轮询数量、长轮询等待时间、访问 IP 数量等因素动态调整长轮询防攻击的并发上限值。当队列无消息时,超过长轮询上限值的请求将无法被监听到,并直接返回 404 MessageNotExist(按请求量正常计费)。如果您有临时提升长轮询上限值的需求,请及时提交工单。></notice>', + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Messages\\": [\\n {\\n \\"MessageId\\": \\"5F290C926D472878214D9529A8FA200000001\\",\\n \\"ReceiptHandle\\": \\"1-ODU4OTkzNDU5My0xNDMyNzI3ODI3LTItOA==\\",\\n \\"MessageBody\\": \\"This is test message 1.\\",\\n \\"MessageBodyMD5\\": \\"C5DD56A39F5F7BB8B3337C6D11B6D8BE\\",\\n \\"EnqueueTime\\": 1250700979348,\\n \\"NextVisibleTime\\": 1250700979348,\\n \\"FirstDequeueTime\\": 1250700979348,\\n \\"DequeueCount\\": 1,\\n \\"Priority\\": 1,\\n \\"MessageGroupId\\": \\"test-group\\",\\n \\"UserProperties\\": {\\n \\"key\\": {\\n \\"DataType\\": \\"\\",\\n \\"StringValue\\": \\"\\",\\n \\"BinaryValue\\": \\"\\"\\n }\\n }\\n }\\n ]\\n}","type":"json"}]', + ], + 'BatchSendMessage' => [ + 'summary' => '向指定队列批量发送最多16条消息,总大小不超过64KB。', + 'path' => '/queues/{queueName}/messages', + 'methods' => ['post'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'body', + 'in' => 'body', + 'style' => 'json', + 'schema' => [ + 'description' => '消息列表'."\n", + 'type' => 'object', + 'properties' => [ + 'Messages' => [ + 'description' => '消息列表'."\n", + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'MessageBody' => ['description' => '消息正文'."\n", 'type' => 'string', 'required' => false, 'example' => 'This is test message 1.'], + 'DelaySeconds' => ['description' => '延迟可消费时间(秒)'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '60'], + 'Priority' => ['description' => '优先级。数值越小优先级越高,1 为最高优先级。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1'], + 'MessageGroupId' => ['description' => '消息分组 ID,同一分组内的消息保证顺序投递。仅 FIFO 队列有效。'."\n", 'type' => 'string', 'required' => false, 'example' => 'group1'], + 'UserProperties' => [ + 'type' => 'object', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + 'required' => false, + 'description' => '', + ], + 'required' => false, + ], + ], + 'required' => false, + 'example' => '{'."\n" + .' "Messages": ['."\n" + .' {'."\n" + .' "MessageBody": "...",'."\n" + .' "DelaySeconds": 60,'."\n" + .' "Priority": 1'."\n" + .' }'."\n" + .' ]'."\n" + .'}', + ], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [ + 'Messages' => [ + 'type' => 'array', + 'items' => [ + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['type' => 'string'], + 'MessageBodyMD5' => ['type' => 'string'], + ], + ], + ], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '批量发送消息', + 'description' => '## 请求说明'."\n" + .'- 一次 Batch 请求的消息总大小不得超过 64 KB。'."\n" + .'- `BatchSendMessage` 与 `SendMessage` 使用相同的 URL 路径,通过 Body 结构区分:包含 `Messages` 数组即为批量发送,否则为单条发送。'."\n" + .'- 批量操作的返回结果可能同时包含成功和失败的子消息。'."\n" + .'- 每次请求中可以包含多个消息对象,每个消息对象可以设置不同的延迟时间和优先级。'."\n" + .'- 对于 FIFO 队列,可以通过 `MessageGroupId` 参数来指定消息分组 ID。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"Messages\\": [\\n {\\n \\"MessageId\\": \\"\\",\\n \\"MessageBodyMD5\\": \\"\\"\\n }\\n ]\\n}","type":"json"}]', + ], + 'ChangeMessageVisibility' => [ + 'summary' => '用于延长或缩短处于 Inactive 状态的消息的不可见时间。', + 'path' => '/queues/{queueName}/messages', + 'methods' => ['put'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'update', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'receiptHandle', + 'in' => 'query', + 'schema' => ['title' => '上次消费后返回的消息的ReceiptHandle。', 'description' => '上次消费后返回的消息临时句柄。'."\n", 'type' => 'string', 'required' => false, 'example' => '1-ODU4OTkzNDU5My0xNDMyNzI3ODI3LTItOA=='], + ], + [ + 'name' => 'visibilityTimeout', + 'in' => 'query', + 'schema' => ['title' => '将消息的可见性超时时间设置为当前入参值,单位:秒。取值范围[1, 43200]秒。', 'description' => '从当前时刻开始,消息重新变为 Active 的倒计时。[1, 43200](秒),即 1 秒 ~ 12 小时', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '50'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => 'Schema of Response', + 'description' => '返回参数包括新的临时句柄和下次可被再次消费的时间(毫秒时间戳)。'."\n", + 'type' => 'object', + 'properties' => [ + 'ReceiptHandle' => ['description' => '新的临时句柄(后续删除/修改操作必须使用此新句柄),NextVisibleTime 之前有效。'."\n", 'type' => 'string', 'example' => 'TbZj6wDWli+9CEauMZc8ZRv37sIW2iJKq3M9Mx/TS1'], + 'NextVisibleTime' => ['description' => '下次可被再次消费的时间(毫秒时间戳)。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '修改消息可见性超时时间', + 'description' => '## 请求说明'."\n" + ."\n" + .'- 该接口允许用户修改已经被消费且当前处于 Inactive 状态的消息的 VisibilityTimeout,即从当前时刻开始到消息重新变为 Active 的倒计时。'."\n" + .'- 调用成功后会返回新的 `ReceiptHandle`,后续删除或再次修改此消息的可见性超时时间时必须使用新句柄。'."\n" + .'- 只能在 `NextVisibleTime` 之前调用成功,否则将收到错误提示。'."\n" + .'- 典型应用场景包括消费者处理耗时较长的情况,需要延长 VisibilityTimeout 以避免消息被重复消费。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"ReceiptHandle\\": \\"TbZj6wDWli+9CEauMZc8ZRv37sIW2iJKq3M9Mx/TS1\\",\\n \\"NextVisibleTime\\": 1250700979348\\n}","type":"json"}]', + ], + 'DeleteMessage' => [ + 'path' => '/queues/{queueName}/messages', + 'methods' => ['delete'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'delete', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'ReceiptHandle', + 'in' => 'query', + 'schema' => ['title' => '上次消费后返回的消息的ReceiptHandle。', 'description' => '上次消费后返回的消息临时句柄。'."\n", 'type' => 'string', 'required' => false, 'example' => '1-ODU4OTkzNDU5My0xNDM1MTk3NjAwLTItNg=='], + ], + ], + 'responses' => [ + 204 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [], + 'description' => '', + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '删除已消费消息', + 'summary' => '通过提供的ReceiptHandle删除已经被消费的消息。', + 'description' => '## 请求说明'."\n" + .'- 消费者需将上次消费返回的 `ReceiptHandle` 作为参数来定位要删除的消息。'."\n" + .'- 本操作只有在 `NextVisibleTime` 之前执行才能成功。超时后消息重新变为 Active 状态,ReceiptHandle 失效,需重新消费获取新句柄。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{}","type":"json"}]', + ], + 'PeekMessage' => [ + 'path' => '/queues/{queueName}/messages', + 'methods' => ['get'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'read', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '队列名称'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'peekonly', + 'in' => 'query', + 'schema' => ['title' => '表示这次请求只是去查看队列顶部的消息并不会引起消息的状态改变。取值固定为true。', 'description' => '表示这次请求只是去查看队列顶部的消息并不会引起消息的状态改变。取值固定为true。', 'type' => 'boolean', 'required' => false, 'default' => 'true'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => 'Schema of Response', + 'description' => '- **MessageId**: 消息编号,在一个队列中唯一。'."\n" + .'- **ReceiptHandle**: 本次获取消息产生的临时句柄,用于删除和修改 Inactive 状态消息,NextVisibleTime 之前有效。'."\n" + .'- **MessageBody**: 消息正文。'."\n" + .'- **MessageBodyMD5**: 消息正文的 MD5 值。'."\n" + .'- **EnqueueTime**: 消息发送到队列的时间,从1970-01-01 00:00:00 000开始的毫秒数。'."\n", + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['description' => '消息编号,在一个队列中唯一。'."\n", 'type' => 'string', 'example' => '5F290C926D472878-2-14D9529A8FA-200000001'], + 'MessageBody' => ['description' => '消息正文。'."\n", 'type' => 'string', 'example' => 'Hello MNS'], + 'MessageBodyMD5' => ['description' => '消息正文的 MD5 值。'."\n", 'type' => 'string', 'example' => 'C5DD56A39F5F7BB8B3337C6D11B6D8BE'], + 'EnqueueTime' => ['description' => '消息发送到队列的时间,从1970-01-01 00:00:00 000开始的毫秒数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'FirstDequeueTime' => ['description' => '第一次被消费的时间(毫秒时间戳)。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'DequeueCount' => ['description' => '总共被消费的次数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'Priority' => ['description' => '优先级,1 最高', 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'MessageGroupId' => ['description' => '消息分组 ID(仅 FIFO 队列)。', 'type' => 'string', 'example' => 'test-group'], + 'UserProperties' => [ + 'description' => '用户自定义属性', + 'type' => 'object', + 'example' => '{"xxx":"value"}', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '查看队列消息', + 'summary' => '查看队列顶部的消息而不改变消息状态。', + 'description' => '## 请求说明'."\n" + .'- **PeekMessage** 接口用于查看队列顶部的消息,但不会改变消息的状态,消息仍处于 Active 状态可被正常消费。'."\n" + .'- 该接口不支持长轮询,如果队列为空则立即返回 `MessageNotExist` 错误。'."\n" + .'- 请求时必须设置 `peekonly=true` 参数以表明仅查看消息。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"MessageId\\": \\"5F290C926D472878-2-14D9529A8FA-200000001\\",\\n \\"MessageBody\\": \\"Hello MNS\\",\\n \\"MessageBodyMD5\\": \\"C5DD56A39F5F7BB8B3337C6D11B6D8BE\\",\\n \\"EnqueueTime\\": 1250700979348,\\n \\"FirstDequeueTime\\": 1250700979348,\\n \\"DequeueCount\\": 1,\\n \\"Priority\\": 1,\\n \\"MessageGroupId\\": \\"test-group\\",\\n \\"UserProperties\\": {\\n \\"key\\": {\\n \\"DataType\\": \\"\\",\\n \\"StringValue\\": \\"\\",\\n \\"BinaryValue\\": \\"\\"\\n }\\n }\\n}","type":"json"}]', + ], + 'PublishMessage' => [ + 'summary' => '向指定的主题发布消息,消息将被推送给所有订阅的Endpoint。', + 'path' => '/topics/{topicName}/messages', + 'methods' => ['post'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'topicName', + 'in' => 'path', + 'schema' => ['description' => '**主题名称**'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyTopic'], + ], + [ + 'name' => 'body', + 'in' => 'body', + 'style' => 'json', + 'schema' => [ + 'description' => '**消息内容**。建议事先 Base64 编码。'."\n", + 'type' => 'object', + 'properties' => [ + 'MessageBody' => ['description' => '**消息内容**。建议事先 Base64 编码。'."\n" + .'最大 64 KB', 'type' => 'string', 'required' => false, 'example' => 'hello topic'], + 'MessageTag' => ['description' => '**消息标签**,用于订阅的消息过滤。'."\n" + .'最大 64 字符', 'type' => 'string', 'required' => false, 'example' => 'order-event'], + 'MessageGroupId' => ['type' => 'string'], + 'MessageAttributes' => [ + 'description' => '**消息属性**。推送到 Queue/HTTP 时不需设置。'."\n", + 'type' => 'object', + 'properties' => [ + 'DirectMail' => ['description' => '**邮件推送属性**(JSON 格式字符串)。'."\n", 'type' => 'string', 'required' => false, 'example' => '详见 https://help.aliyun.com/zh/direct-mail/singlesendmail'], + 'DirectSMS' => ['description' => '短信推送属性(JSON 格式字符串),包含 `FreeSignName`、`TemplateCode`、`Type`、`Receiver`、`SmsParams`。'."\n", 'type' => 'string', 'required' => false, 'example' => '{"FreeSignName":"阿里云","TemplateCode":"SMS_123456","Type":"singleContent","Receiver":"13800000000","SmsParams":"{\\"code\\":\\"1234\\"}"}'], + 'Push' => ['description' => '移动推送属性(JSON 格式字符串)。'."\n", 'type' => 'string', 'required' => false, 'example' => '移动推送属性示例值'], + ], + 'required' => false, + ], + ], + 'required' => false, + ], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['type' => 'string'], + 'MessageBodyMD5' => ['type' => 'string'], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '发布主题消息', + 'description' => '## 请求说明'."\n" + ."\n" + .'- 消息发布后会被推送到该 Topic 下所有 Subscription 的 Endpoint。'."\n" + .'- 推送到 Queue 和 HTTP Endpoint 时不需要设置 `MessageAttributes`。'."\n" + .'- 推送到邮件、短信或移动推送时需要设置对应的 `MessageAttributes` 子属性。'."\n" + .'- 消息内容建议事先进行 Base64 编码以避免特殊字符问题。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"MessageId\\": \\"\\",\\n \\"MessageBodyMD5\\": \\"\\"\\n}","type":"json"}]', + ], + 'ReceiveMessage' => [ + 'summary' => '从指定队列中获取并锁定一条消息,用于处理。', + 'path' => '/queues/{queueName}/messages', + 'methods' => ['get'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'read', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'get', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '**队列名称**'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'waitseconds', + 'in' => 'query', + 'schema' => ['title' => '本次ReceiveMessage请求最长的Polling等待时间,单位为秒。', 'description' => '**本次请求最长的 Polling 等待时间(秒)**。设为 0 表示立即返回。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '0'], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'title' => 'Schema of Response', + 'description' => 'Schema of Response', + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['description' => '**消息编号**,在一个队列中唯一。'."\n", 'type' => 'string', 'example' => '5F290C926D472878-2-14D9529A8FA-200000001'], + 'ReceiptHandle' => ['description' => '**本次获取消息产生的临时句柄**,用于删除和修改 Inactive 状态消息,NextVisibleTime 之前有效。'."\n", 'type' => 'string', 'example' => '1-ODU4OTkzNDU5My0xNDM1MTk3NjAwLTItNg=='], + 'MessageBody' => ['description' => '**消息正文**。'."\n", 'type' => 'string', 'example' => 'Hello MNS'], + 'MessageBodyMD5' => ['description' => '消息正文的 MD5 值。'."\n", 'type' => 'string', 'example' => 'C5DD56A39F5F7BB8B3337C6D11B6D8BE'], + 'EnqueueTime' => ['description' => '消息发送到队列的时间,从1970-01-01 00:00:00 000开始的毫秒数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'NextVisibleTime' => ['description' => '下次可被再次消费的时间(毫秒时间戳)。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'FirstDequeueTime' => ['description' => '第一次被消费的时间(毫秒时间戳)。若 DequeueCount=0 则与 EnqueueTime 相同。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1250700979348'], + 'DequeueCount' => ['description' => '总共被消费的次数。'."\n", 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'Priority' => ['description' => '优先级,1 最高', 'type' => 'integer', 'format' => 'int64', 'example' => '1'], + 'MessageGroupId' => ['description' => '消息分组 ID(仅 FIFO 队列)。', 'type' => 'string', 'example' => 'test-group'], + 'UserProperties' => [ + 'description' => '用户自定义属性', + 'type' => 'object', + 'example' => '{"xxx":"value"}', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '消费消息', + 'description' => '## 请求说明'."\n" + ."\n" + .'- `ReceiveMessage` 操作会将取得的消息状态变为 Inactive,Inactive 持续时间由队列属性 `VisibilityTimeout` 决定。'."\n" + .'- 消费者需在 VisibilityTimeout 时间内消费成功后调用 `DeleteMessage` 删除该消息,否则消息将重新变为 Active 状态,被再次消费。'."\n" + .'- 支持长轮询(Long Polling):设置 `waitseconds > 0` 后,若队列为空则等待至有消息到达或超时返回。'."\n" + .'><notice>进入长轮询后,建议您降低外部调用长轮询的并发数,选择合适的长轮询时间。目前服务端会根据长轮询数量、长轮询等待时间、访问 IP 数量等因素动态调整长轮询防攻击的并发上限值。当队列无消息时,超过长轮询上限值的请求将无法被监听到,并直接返回 404 MessageNotExist(按请求量正常计费)。如果您有临时提升长轮询上限值的需求,请及时提交工单。></notice>', + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"MessageId\\": \\"5F290C926D472878-2-14D9529A8FA-200000001\\",\\n \\"ReceiptHandle\\": \\"1-ODU4OTkzNDU5My0xNDM1MTk3NjAwLTItNg==\\",\\n \\"MessageBody\\": \\"Hello MNS\\",\\n \\"MessageBodyMD5\\": \\"C5DD56A39F5F7BB8B3337C6D11B6D8BE\\",\\n \\"EnqueueTime\\": 1250700979348,\\n \\"NextVisibleTime\\": 1250700979348,\\n \\"FirstDequeueTime\\": 1250700979348,\\n \\"DequeueCount\\": 1,\\n \\"Priority\\": 1,\\n \\"MessageGroupId\\": \\"test-group\\",\\n \\"UserProperties\\": {\\n \\"key\\": {\\n \\"DataType\\": \\"\\",\\n \\"StringValue\\": \\"\\",\\n \\"BinaryValue\\": \\"\\"\\n }\\n }\\n}","type":"json"}]', + ], + 'SendMessage' => [ + 'path' => '/queues/{queueName}/messages', + 'methods' => ['post'], + 'schemes' => ['https'], + 'security' => [ + [ + 'AK' => [], + ], + ], + 'consumes' => ['application/json'], + 'produces' => ['application/json'], + 'operationType' => 'write', + 'deprecated' => false, + 'systemTags' => ['operationType' => 'create', 'riskType' => 'none', 'chargeType' => 'paid'], + 'parameters' => [ + [ + 'name' => 'queueName', + 'in' => 'path', + 'schema' => ['description' => '**队列名称**'."\n", 'type' => 'string', 'required' => false, 'example' => 'MyQueue'], + ], + [ + 'name' => 'body', + 'in' => 'body', + 'style' => 'json', + 'schema' => [ + 'description' => '请求Body', + 'type' => 'object', + 'properties' => [ + 'MessageBody' => ['description' => '**消息正文**。建议事先进行 Base64 编码以避免特殊字符问题。'."\n", 'type' => 'string', 'required' => false, 'example' => '"Hello MNS"'], + 'DelaySeconds' => ['description' => '**消息发送后延迟可被消费的时间**,单位:秒。最大 7 天。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '0'], + 'Priority' => ['description' => '**消息优先级**。数值越小优先级越高,1 为最高优先级。'."\n", 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '2'], + 'MessageGroupId' => ['description' => '**消息分组 ID**,同一分组内的消息保证顺序投递。仅 FIFO 队列有效'."\n", 'type' => 'string', 'required' => false, 'example' => 'group-123'], + 'UserProperties' => [ + 'description' => '用户自定义属性。'."\n", + 'type' => 'object', + 'required' => false, + 'example' => '{"key1":"value1", "key2":"value2"}', + 'additionalProperties' => [ + 'type' => 'object', + 'properties' => [ + 'DataType' => ['type' => 'string'], + 'StringValue' => ['type' => 'string'], + 'BinaryValue' => ['type' => 'string'], + ], + ], + ], + ], + 'required' => false, + 'example' => '{'."\n" + .' "MessageBody": "Hello MNS",'."\n" + .' "DelaySeconds": 60,'."\n" + .' "Priority": 1'."\n" + .'}', + ], + ], + ], + 'responses' => [ + 200 => [ + 'schema' => [ + 'type' => 'object', + 'properties' => [ + 'MessageId' => ['type' => 'string'], + 'MessageBodyMD5' => ['type' => 'string'], + 'ReceiptHandle' => ['type' => 'string'], + ], + ], + ], + ], + 'staticInfo' => ['returnType' => 'synchronous'], + 'title' => '发送消息到队列', + 'summary' => '向指定的队列发送一条消息,支持设置延迟和优先级。', + 'description' => '## 请求说明'."\n" + .'- **SendMessage** 接口用于将消息发送至指定队列。'."\n" + .'- 消息可以立即被消费或通过设置 `DelaySeconds` 参数来延迟消费。'."\n" + .'- 发送的消息可以指定优先级,数值越小表示优先级越高。'."\n" + .'- 对于 FIFO 队列,可以通过 `MessageGroupId` 来保证同一分组内消息的顺序投递。'."\n" + .'- 用户还可以自定义属性 `UserProperties`,以 JSON 格式字符串形式提供额外信息。'."\n" + .'- 当 `DelaySeconds` 大于 0 时,API 返回的 `ReceiptHandle` 可用来在消息变为 Active 状态前删除该延迟消息。'."\n", + 'changeSet' => [], + 'responseDemo' => '[{"errorExample":"","example":"{\\n \\"MessageId\\": \\"\\",\\n \\"MessageBodyMD5\\": \\"\\",\\n \\"ReceiptHandle\\": \\"\\"\\n}","type":"json"}]', + ], + ], + 'endpoints' => [], + 'errorCodes' => [], + 'changeSet' => [], +]; |
