'1.0',
'info' => ['style' => 'RPC', 'product' => 'amqp-open', 'version' => '2019-12-12'],
'directories' => [
[
'children' => ['CreateInstance', 'GetInstance', 'UpdateInstance', 'UpdateInstanceName', 'GetMetadataAmount', 'ListInstances', 'AddInstanceWhiteList', 'ListInstanceWhiteList', 'RemoveInstanceWhiteList'],
'type' => 'directory',
'title' => '实例',
'id' => 90500,
],
[
'children' => ['CreateVirtualHost', 'DeleteVirtualHost', 'ListVirtualHosts'],
'type' => 'directory',
'title' => 'Vhost',
'id' => 90530,
],
[
'children' => ['CreateQueue', 'DeleteQueue', 'ListQueueConsumers', 'ListQueues', 'ListQueueUpStreamBindings'],
'type' => 'directory',
'title' => 'Queue',
'id' => 90536,
],
[
'children' => ['CreateExchange', 'DeleteExchange', 'ListDownStreamBindings', 'ListExchanges', 'ListExchangeUpStreamBindings'],
'type' => 'directory',
'title' => 'Exchange',
'id' => 90520,
],
[
'children' => ['CreateBinding', 'DeleteBinding', 'ListBindings'],
'type' => 'directory',
'title' => 'Binding',
'id' => 90422,
],
[
'children' => ['CreateAccount', 'DeleteAccount', 'ListAccounts'],
'type' => 'directory',
'title' => '静态用户名密码',
'id' => 90545,
],
[
'children' => ['CreateOpenSourceAccount', 'CreateOpenSourcePermission', 'DeleteOpenSourceAccount', 'DeleteOpenSourcePermission', 'ListOpenSourceAccounts', 'ListOpenSourcePermissions', 'UpdateInstanceServerlessSwitch', 'UpdateOpenSourceAccount', 'UpdateOpenSourcePermission'],
'type' => 'directory',
'title' => '其他',
'id' => 454622,
],
],
'components' => [
'schemas' => [],
],
'apis' => [
'AddInstanceWhiteList' => [
'summary' => '增加实例白名单',
'path' => '',
'methods' => ['post'],
'schemes' => ['https'],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'update',
'riskType' => 'none',
'chargeType' => 'free',
'abilityTreeNodes' => ['FEATUREonsSGDS5X'],
'tenantRelevance' => 'tenant',
],
'parameters' => [
[
'name' => 'InstanceId',
'in' => 'query',
'schema' => ['title' => '需要创建IP/VPC的实例ID'."\n", 'description' => '需要创建IP/VPC的实例ID'."\n", 'type' => 'string', 'required' => true, 'example' => 'rabbitmq-cn-xxx'],
],
[
'name' => 'WhiteListItem',
'in' => 'query',
'style' => 'json',
'schema' => [
'title' => '白名单IP或vpcId,IP以网段的形式设置',
'description' => '白名单IP或vpcId,IP以网段的形式设置',
'type' => 'array',
'items' => ['description' => '白名单具体值。'."\n"
.'如果需要设置IP白名单,则填写IP范围,下面WhiteListType填写2;'."\n"
.'如果需要设置VPC白名单,则填写VPCID范围,下面WhiteListType填写1;', 'type' => 'string', 'required' => true, 'example' => '172.0.0.20/30'],
'required' => true,
'example' => '172.0.0.20/30',
],
],
[
'name' => 'WhiteListType',
'in' => 'query',
'schema' => [
'title' => '白名单类型。'."\n"
.'如果WhiteListItem中是IP类型,WhiteListType设置为2;如果WhiteListItem中设置vpcId,则WhiteListType设置1。'."\n"
."\n"
.'vpc白名单仅针对vpc接入点是anytunnel类型的实例。最新版本实例vpc接入点为privateLink类型,因此不能针对此种类型实例设置vpc白名单。',
'description' => '白名单类型。'."\n"
.'如果WhiteListItem中是IP类型,WhiteListType设置为2;如果WhiteListItem中设置vpcId,则WhiteListType设置1。'."\n"
."\n"
.'vpc白名单仅针对vpc接入点是anytunnel类型的实例。最新版本实例vpc接入点为privateLink类型,因此不能针对此种类型实例设置vpc白名单。',
'type' => 'integer',
'format' => 'int32',
'required' => true,
'example' => '2',
'enum' => ['1', '2'],
],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => 'Schema of Response',
'type' => 'object',
'properties' => [
'RequestId' => ['title' => 'Id of the request', 'description' => 'Id of the request', 'type' => 'string', 'example' => '8BFB1C9D-08A2-4859-A47C-403C9EFA2***'],
'Code' => ['description' => '返回码。返回200代表成功。', 'type' => 'string', 'example' => '200'],
'Message' => ['description' => '报错时返回错误信息', 'type' => 'string', 'example' => 'The specified parameter \'[\\"vpc-xxx\\"]\' is not valid'],
'Success' => ['description' => '执行结果是否成功。', 'type' => 'boolean', 'example' => 'true'],
'Data' => ['description' => '请求是否成功', 'type' => 'any', 'example' => 'true'],
'StatusCode' => ['description' => '调用返回码,200标识为成功', 'type' => 'string', 'example' => '200'],
],
],
],
],
'errorCodes' => [
404 => [
['errorCode' => 'InstanceNotExist', 'errorMessage' => 'The instance resource does not exist.', 'description' => '实例资源不存在'],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'title' => '增加实例IP/VPCID白名单',
'changeSet' => [],
'flowControl' => [
'flowControlList' => [],
],
'ramActions' => [],
'responseDemo' => '[{"errorExample":"","example":"{\\n \\"RequestId\\": \\"8BFB1C9D-08A2-4859-A47C-403C9EFA2***\\",\\n \\"Code\\": \\"200\\",\\n \\"Message\\": \\"The specified parameter \'[\\\\\\\\\\\\\\"vpc-xxx\\\\\\\\\\\\\\"]\' is not valid\\",\\n \\"Success\\": true,\\n \\"Data\\": \\"true\\",\\n \\"StatusCode\\": \\"200\\"\\n}","type":"json"}]',
],
'CreateAccount' => [
'summary' => '开源客户端访问云消息队列 RabbitMQ 版服务端时,需要传入用户名和密码进行权限认证,认证通过才允许访问服务端。云消息队列 RabbitMQ 版支持通过阿里云访问控制(RAM)的AccessKey和AccessKey Secret生成用户名和密码。',
'methods' => ['post'],
'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'readAndWrite',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'none',
'chargeType' => 'free',
'abilityTreeCode' => '164698',
'abilityTreeNodes' => ['FEATUREonsSLSXRS'],
'tenantRelevance' => 'publicInformation',
],
'parameters' => [
[
'name' => 'instanceId',
'in' => 'query',
'schema' => ['description' => '消息队列RabbitMQ版实例的ID,表示您需要为哪个实例创建静态用户名密码。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'amqp-cn-*********'],
],
[
'name' => 'accountAccessKey',
'in' => 'query',
'schema' => ['description' => '您的阿里云账号或RAM用户的AccessKey ID。获取方式,请参见[创建AccessKey](~~116401~~)。'."\n"
."\n"
.'> 如果您使用RAM用户的AccessKey创建的静态用户名密码接入消息队列RabbitMQ版并收发消息,请确保该RAM用户已被授予收发消息权限。更多信息,请参见[RAM权限策略](~~146559~~)。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'yourAccessKeyID'],
],
[
'name' => 'userName',
'in' => 'query',
'schema' => ['description' => '待创建的静态用户名。'."\n"
."\n"
.'该参数值由实例ID和AccessKey ID构造的字符串经过Base64编码得出,具体计算方法,请参见本文中的**用户名计算示例代码**。'."\n", 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'Mjo****************'],
],
[
'name' => 'signature',
'in' => 'query',
'schema' => ['description' => '签名,系统将根据请求参数中的签名、AccessKey Secret签名和用户名计算出静态用户密码。'."\n"
."\n"
.'签名由指定的用户名创建时间戳和AccessKey ID进行HmacSHA1加密算法计算得出。具体计算方法,请参见本文中的**签名算法示例代码**。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => '22c2d7d1769cb53c5a6d9213248e2de524******'],
],
[
'name' => 'createTimestamp',
'in' => 'query',
'schema' => ['description' => '指定该用户名密码创建的时间戳。单位:毫秒。'."\n"
."\n"
.'> 该时间戳用于计算静态用户密码,由您自定义设置。不是系统生成用户名密码时的时间戳。', 'type' => 'integer', 'format' => 'int64', 'required' => true, 'docRequired' => true, 'example' => '1671175303522'],
],
[
'name' => 'secretSign',
'in' => 'query',
'schema' => ['description' => 'AccessKey Secret签名,系统将根据请求参数中的签名、AccessKey Secret签名和用户名计算出静态用户密码。'."\n"
."\n"
.'AccessKey Secret签名由指定的用户名创建时间戳和AccessKey ID进行HmacSHA1加密算法计算得出。具体计算方法,请参见本文中的**签名算法示例代码**。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => '4c1a6367ce4c4255e9617326f9133ac635******'],
],
[
'name' => 'Remark',
'in' => 'query',
'schema' => ['title' => '静态用户备注', 'description' => '静态用户备注', 'type' => 'string', 'required' => false, 'example' => '*** environment'],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'Schema of Response',
'description' => '返回结果。',
'type' => 'object',
'properties' => [
'RequestId' => [
'title' => 'Id of the request',
'description' => '请求ID。',
'type' => 'string',
'enumValueTitles' => [],
'example' => 'FEBA5E0C-50D0-4FA6-A794-4901E5465***',
],
'Code' => ['description' => '返回码。返回200代表成功。', 'type' => 'integer', 'format' => 'int32', 'example' => '200'],
'Message' => ['description' => '返回信息。', 'type' => 'string', 'example' => 'operation success'],
'Success' => ['description' => '执行结果是否成功。', 'type' => 'boolean', 'example' => 'true'],
'Data' => [
'description' => '返回数据。',
'type' => 'object',
'properties' => [
'AccessKey' => ['description' => '创建该用户名密码所使用的AccessKey ID。', 'type' => 'string', 'example' => 'LTAI****************'],
'Password' => ['description' => '创建的静态用户密码。', 'type' => 'string', 'example' => 'OUYwQzM2QjZBRkUxNDRFM***************MzZCNzdDQzoxNjcxNDMwMzkyODI1'],
'CreateTimeStamp' => ['description' => '创建用户名密码的时间戳。单位:毫秒。', 'type' => 'integer', 'format' => 'int64', 'example' => '1671175303522'],
'InstanceId' => ['description' => '消息队列RabbitMQ版实例的ID。', 'type' => 'string', 'example' => 'amqp-cn-*********'],
'MasterUId' => ['description' => '创建静态用户名密码的AccessKey所属的阿里云账号或RAM用户的账号ID。', 'type' => 'integer', 'format' => 'int64', 'example' => '1565***********01'],
'UserName' => ['description' => '创建的静态用户名。', 'type' => 'string', 'example' => 'MjphbXFwLWNuLXVxbTJ6cjc2djAwMzpMVEFJNX*******ZNMWVSWnRFSjZ2Zm8='],
'Remark' => ['title' => '备注', 'description' => '备注', 'type' => 'string', 'example' => '*** environment'],
],
],
],
],
],
],
'staticInfo' => ['returnType' => 'synchronous'],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"FEBA5E0C-50D0-4FA6-A794-4901E5465***\\",\\n \\"Code\\": 200,\\n \\"Message\\": \\"operation success\\",\\n \\"Success\\": true,\\n \\"Data\\": {\\n \\"AccessKey\\": \\"LTAI****************\\",\\n \\"Password\\": \\"OUYwQzM2QjZBRkUxNDRFM***************MzZCNzdDQzoxNjcxNDMwMzkyODI1\\",\\n \\"CreateTimeStamp\\": 1671175303522,\\n \\"InstanceId\\": \\"amqp-cn-*********\\",\\n \\"MasterUId\\": 0,\\n \\"UserName\\": \\"MjphbXFwLWNuLXVxbTJ6cjc2djAwMzpMVEFJNX*******ZNMWVSWnRFSjZ2Zm8=\\",\\n \\"Remark\\": \\"*** environment\\"\\n }\\n}","errorExample":""},{"type":"xml","example":"\\n FEBA5E0C-50D0-4FA6-A794-4901E5465***\\n 200\\n operation success\\n true\\n \\n LTAI5***********eRZtEJ6vfo\\n OUYwQzM2QjZBRkUxNDRFM***************MzZCNzdDQzoxNjcxNDMwMzkyODI1\\n 1671175303522\\n amqp-cn-*********\\n MjphbXFwLWNuLXVxbTJ6cjc2djAwMzpMVEFJNX*******ZNMWVSWnRFSjZ2Zm8=\\n \\n","errorExample":""}]',
'title' => '创建用户名密码',
'description' => '### 背景信息'."\n"
.'开源客户端访问云消息队列 RabbitMQ 版服务端时,需要传入用户名和密码进行权限认证,认证通过才允许访问服务端。'."\n"
.'云消息队列 RabbitMQ 版支持通过阿里云访问控制(RAM)的AccessKey和AccessKey Secret生成用户名和密码。'."\n"
.'### 注意事项'."\n"
.'- 创建静态用户名密码所属的实例需处于服务中状态。'."\n"
.'- 一个实例下的AccessKey和静态用户名密码一一对应,即一个实例下的一个AccessKey只能创建一个静态用户名密码。'."\n"
.'- 如果需要更新静态用户名密码,您可以删除该静态用户名密码后重新创建。'."\n"
.'### 用户名计算示例代码'."\n"
.'请求参数中的userName的参数值,需要由实例ID和AccessKey ID构造字符串并进行Base64编码得出。具体的计算方法如下:'."\n"
.'```'."\n"
.'import java.nio.charset.Charset;'."\n"
.'import java.nio.charset.StandardCharsets;'."\n"
.'import java.util.Base64;'."\n"
."\n"
.'public class Base64Utils {'."\n"
.' public static final Charset UTF8 = StandardCharsets.UTF_8;'."\n"
."\n"
.' /**'."\n"
.' * 解码 base64 字符串'."\n"
.' *'."\n"
.' * @param str'."\n"
.' * @return'."\n"
.' */'."\n"
.' public static String decode(String str) {'."\n"
.' return new String(Base64.getDecoder().decode(str.getBytes(UTF8)), UTF8);'."\n"
.' }'."\n"
."\n"
.' public static String encode(String bytes) {'."\n"
.' return new String(Base64.getEncoder().encode(bytes.getBytes(UTF8)), UTF8);'."\n"
.' }'."\n"
."\n"
.' public static void main(String[] args) {'."\n"
.' //使用您的实例 ID 以及购买该实例的账号 AK,组成字符串。'."\n"
.' String str = "2:${instanceId}:${ak}";'."\n"
."\n"
.' //生成 API 使用的 userName。'."\n"
.' String userName = encode(str);'."\n"
.' System.out.println("userName=" + userName);'."\n"
."\n"
.' String decodeStr = decode(userName);'."\n"
.' System.out.println("originStr=" + decodeStr);'."\n"
.' }'."\n"
.'}'."\n"
.'```'."\n"
."\n"
.'### 签名算法示例代码'."\n"
.'请求参数中signature和secretSign的参数值,需要由指定的静态用户名的创建时间戳和AccessKey Secret进行加密算法计算得出。具体的算法和示例代码如下:'."\n"
.'```'."\n"
.'import javax.crypto.Mac;'."\n"
.'import javax.crypto.spec.SecretKeySpec;'."\n"
.'import java.security.InvalidKeyException;'."\n"
.'import java.security.NoSuchAlgorithmException;'."\n"
."\n"
.'public class SignatureUtils {'."\n"
."\n"
.' public static String hamcsha1(byte[] data, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException {'."\n"
.' SecretKeySpec signingKey = new SecretKeySpec(key, "HmacSHA1");'."\n"
.' Mac mac = Mac.getInstance("HmacSHA1");'."\n"
.' mac.init(signingKey);'."\n"
.' return byte2hex(mac.doFinal(data));'."\n"
.' }'."\n"
."\n"
.' public static String byte2hex(byte[] b) {'."\n"
.' StringBuilder hs = new StringBuilder();'."\n"
.' String stmp;'."\n"
.' for (int n = 0; b != null && n < b.length; n++) {'."\n"
.' stmp = Integer.toHexString(b[n] & 0XFF);'."\n"
.' if (stmp.length() == 1) {'."\n"
.' hs.append(\'0\');'."\n"
.' }'."\n"
.' hs.append(stmp);'."\n"
.' }'."\n"
.' return hs.toString().toUpperCase();'."\n"
.' }'."\n"
."\n"
.' public static void main(String[] args) throws InvalidKeyException, NoSuchAlgorithmException {'."\n"
.' //createTimestamp 即是 API 的 createTimestamp 参数。'."\n"
.' String createTimestamp = String.valueOf(System.currentTimeMillis());'."\n"
.' System.out.println("timestamp:" + createTimestamp);'."\n"
."\n"
.' //您账号的 sk。'."\n"
.' String sk = "${sk}";'."\n"
."\n"
.' //生成 API 使用的 SecretSign。'."\n"
.' String SecretSign = hamcsha1(sk.getBytes(), createTimestamp.getBytes());'."\n"
.' System.out.println("SecretSign:" + SecretSign);'."\n"
."\n"
.' //生成 API 使用的 signature。'."\n"
.' String signature = hamcsha1(createTimestamp.getBytes(), sk.getBytes());'."\n"
.' System.out.println("signature:" + signature);'."\n"
.' }'."\n"
.'}'."\n"
.'```',
'extraInfo' => '### 控制台操作'."\n"
.'除了调用**CreateAccount**接口,您还可以通过云消息队列 RabbitMQ 版控制台创建静态用户名密码。具体操作,请参见[静态用户名密码管理](~~184399~~)。',
'changeSet' => [],
'flowControl' => [
'flowControlList' => [
['threshold' => '100', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateAccount'],
],
],
'ramActions' => [
[
'operationType' => 'create',
'ramAction' => [
'action' => 'amqp:FetchStaticAccount',
'authLevel' => 'resource',
'actionConditions' => [],
'resources' => [
['validationType' => 'always', 'product' => 'Amqp', 'resourceType' => 'Instance', 'arn' => 'acs:amqp:{#regionId}:{#accountId}:/instances/{#instanceId}'],
],
],
'additionalActions' => [
['action' => 'amqp:GetInstance'],
],
],
],
],
'CreateBinding' => [
'summary' => 'Producer将消息发送到Exchange,Exchange根据创建的绑定关系以及路由规则选择将消息路由到指定的Queue或其他Exchange中。',
'methods' => ['post'],
'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'write',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'none',
'chargeType' => 'free',
'abilityTreeCode' => '58722',
'abilityTreeNodes' => ['FEATUREons5ZTT5D'],
],
'parameters' => [
[
'name' => 'InstanceId',
'in' => 'formData',
'schema' => ['description' => '云消息队列 RabbitMQ 版实例的ID。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'amqp-cn-v0h1kb9nu***'],
],
[
'name' => 'VirtualHost',
'in' => 'formData',
'schema' => ['description' => 'Vhost名称。'."\n"
.'此Vhost已在控制台创建且是**DestinationName**和**SourceExchange**所属的Vhost。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'test'],
],
[
'name' => 'SourceExchange',
'in' => 'formData',
'schema' => ['description' => '源Exchange名称,且此Exchange已在控制台创建。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'NormalEX'],
],
[
'name' => 'DestinationName',
'in' => 'formData',
'schema' => ['description' => '绑定目标名称。'."\n"
.'此绑定目标需已在控制台创建且所属Vhost与**SourceExchange**所属Vhost一致,即在**VirtualHost**中。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'DemoQueue'],
],
[
'name' => 'BindingKey',
'in' => 'formData',
'schema' => ['description' => '绑定键。'."\n"
."\n"
.'- 绑定源Exchange为非Topic类型:'."\n"
."\n"
.' - 只能包含字母、数字、短划线(-)、下划线(_)、半角句号(.)、正斜线(/)、at符号(@)。'."\n"
."\n"
.' - 长度限制1~255字符。'."\n"
."\n"
.'- 绑定源Exchange为Topic类型:'."\n"
."\n"
.' - 可以包含字母、数字、短划线(-)、下划线(_)、星号(*)、半角句号(.)、井号(#)、正斜线(/)、at符号(@)。'."\n"
."\n"
.' - 不能以半角句号(.)开头或结尾。对于井号(#)或星号(*),如果以其开头,则其后需有半角句号(.),如果以其结尾,则其前需有半角句号(.),如果既不是开头也不是结尾,则其前后均需有半角句号(.)。'."\n"
."\n"
.' - 长度限制1~255字符。', 'type' => 'string', 'required' => false, 'docRequired' => false, 'example' => '.test'],
],
[
'name' => 'BindingType',
'in' => 'formData',
'schema' => ['description' => '绑定目标对象的类型。取值:'."\n"
."\n"
.'- **0:**Queue'."\n"
."\n"
.'- **1:**Exchange '."\n", 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => '0'],
],
[
'name' => 'Argument',
'in' => 'formData',
'schema' => ['description' => '设置消息头属性键值对信息,消息头属性使用一个或多个键值对拼接而成。x-match属性必须配置,其余属性可自定义。x-match属性取值如下:'."\n"
."\n"
.'- **all:**默认值,所有消息头的键值对必须匹配。'."\n"
."\n"
.'- **any:**至少一对消息头的键值对必须匹配。'."\n"
."\n"
.'属性之间使用半角分号(;)隔开,属性键与值之间使用半角冒号(:)区分。例如x-match:all;type:report;format:pdf'."\n"
.'该参数适用于Headers Exchange,对其它类型的Exchange无效。其它类型的Exchange,此处可以填任意值。', 'type' => 'string', 'required' => false, 'docRequired' => false, 'example' => 'x-match:all;type:report;format:pdf '],
],
],
'responses' => [
200 => [
'schema' => [
'type' => 'object',
'properties' => [
'RequestId' => ['description' => '请求ID。', 'type' => 'string', 'example' => '09768C14-E51C-4F4A-8077-30810032C***'],
],
'description' => '',
],
],
],
'title' => '创建绑定',
'requestParamsDescription' => ' ',
'responseParamsDescription' => ' ',
'extraInfo' => ' ',
'changeSet' => [
['createdAt' => '2024-11-19T11:07:29.000Z', 'description' => '请求参数发生变更'],
['createdAt' => '2024-11-13T03:50:52.000Z', 'description' => '请求参数发生变更'],
['createdAt' => '2024-11-12T11:11:52.000Z', 'description' => '请求参数发生变更'],
['createdAt' => '2023-11-03T02:39:27.000Z', 'description' => '错误码发生变更'],
],
'flowControl' => [
'flowControlList' => [
['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateBinding'],
],
],
'ramActions' => [
[
'operationType' => 'create',
'ramAction' => [
'action' => 'amqp:GetExchange',
'authLevel' => 'resource',
'actionConditions' => [],
'resources' => [
['validationType' => 'always', 'product' => 'Amqp', 'resourceType' => 'Queue', 'arn' => 'acs:amqp:{#regionId}:{#accountId}:/instances/{#InstanceId}/vhosts/{#vhostName}/queues/*'],
],
],
'additionalActions' => [
['action' => 'amqp:CreateExchange', 'validationType' => 'conditional'],
['action' => 'amqp:CreateQueue'],
['action' => 'amqp:GetVhost'],
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"09768C14-E51C-4F4A-8077-30810032C***\\"\\n}","errorExample":""},{"type":"xml","example":"\\n 09768C14-E51C-4F4A-8077-30810032C***\\n","errorExample":""}]',
],
'CreateExchange' => [
'summary' => 'Producer将消息发送到Exchange,由Exchange将消息路由到一个或多个Queue中(或者丢弃)。Exchange根据Routing Key和Binding Key将消息路由到Queue。',
'methods' => ['post'],
'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'write',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'none',
'chargeType' => 'free',
'abilityTreeNodes' => ['FEATUREonsUA0VH5'],
],
'parameters' => [
[
'name' => 'InstanceId',
'in' => 'formData',
'schema' => ['description' => '实例ID。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'amqp-cn-v0h1kb9nu***'],
],
[
'name' => 'VirtualHost',
'in' => 'formData',
'schema' => ['description' => 'Exchange所在的Vhost名称。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'test'],
],
[
'name' => 'ExchangeName',
'in' => 'formData',
'schema' => ['description' => 'Exchange名称。说明:'."\n"
."\n"
.'- Exchange名称只能包含字母、数字、短划线(-)、下划线(_)、半角句号(.)、井号(#)、正斜线(/)、at 符号(@),长度限制1~255 字符。'."\n"
."\n"
.'- Exchange创建后,名称不支持修改,只能删除后重建。', 'type' => 'string', 'required' => true, 'docRequired' => true, 'example' => 'DemoExchange'],
],
[
'name' => 'ExchangeType',
'in' => 'formData',
'schema' => [
'description' => 'Exchange类型。取值:'."\n"
."\n"
.'- **DIRECT**:该类型路由规则会将消息路由到Binding Key与Routing Key完全匹配的Queue中。'."\n"
."\n"
.'- **TOPIC**:该类型与DIRECT类型相似,使用Routing Key模式匹配和字符串比较的方式将消息路由至绑定的Queue。'."\n"
."\n"
.'- **FANOUT**:该类型路由规则非常简单,会把所有发送到该Exchange的消息路由到所有与它绑定的Queue中,相当于广播功能。'."\n"
."\n"
.'- **HEADERS**:该类型与DIRECT类型相似。Headers Exchange使用Headers属性代替Routing Key进行路由匹配,在绑定Headers Exchange和Queue时,设置绑定属性的键值对;在向Headers Exchange发送消息时,设置消息的Headers属性键值对,使用消息Headers属性键值对和绑定属性键值对比较的方式将消息路由至绑定的Queue。'."\n",
'type' => 'string',
'required' => true,
'docRequired' => true,
'example' => 'DIRECT',
'enum' => ['DIRECT', 'TOPIC', 'FANOUT', 'HEADERS', 'X_JMS_TOPIC', 'X_DELAYED_MESSAGE', 'X_CONSISTENT_HASH'],
],
],
[
'name' => 'XDelayedType',
'in' => 'formData',
'schema' => [
'description' => 'x-delayed-message 类型的 Exchange 可以自定义消息的 Header 属性, x-delay用来指定消息延时投递的时间段,单位为毫秒。该类 Exchange 的路由规则取决于 x-delayed-type 参数中指定的 Exchange 类型,用于指定延迟消息最终将被投递到的实际 Exchange 类型。取值:'."\n"
."\n"
.'- **DIRECT**:将延迟消息投递到和 DIRECT 类型 Exchange 绑定的指定队列。'."\n"
.'- **TOPIC**:将延迟消息投递到和 TOPIC 类型 Exchange 绑定的队列。'."\n"
."\n"
.'- **FANOUT**:将延迟消息投递到和 FANOUT 类型 Exchange 绑定的队列。'."\n"
."\n"
.'- **HEADERS**:将延迟消息投递到和 HEADERS 类型 Exchange 绑定的队列。'."\n"
."\n"
.'- **X-JMS-TOPIC**:将延迟消息投递到和X-JMS-TOPIC绑定的队列。',
'type' => 'string',
'required' => false,
'example' => 'DIRECT',
'enum' => ['DIRECT', 'TOPIC', 'FANOUT', 'HEADERS', 'X_JMS_TOPIC'],
],
],
[
'name' => 'AutoDeleteState',
'in' => 'formData',
'schema' => ['description' => '是否自动删除。取值:'."\n"
."\n"
.'- **true**:是。如果绑定到该Exchange的最后一个Queue解除绑定,该Exchange会自动删除。'."\n"
."\n"
.'- **false**:否。如果绑定到该Exchange的最后一个Queue解除绑定,该Exchange不会自动删除。', 'type' => 'boolean', 'required' => true, 'docRequired' => true, 'example' => 'false'],
],
[
'name' => 'Internal',
'in' => 'formData',
'schema' => ['description' => '是否为内部Exchange。取值:'."\n"
."\n"
.'- **false**:否'."\n"
."\n"
.'- **true**:是', 'type' => 'boolean', 'required' => true, 'docRequired' => true, 'example' => 'false'],
],
[
'name' => 'AlternateExchange',
'in' => 'formData',
'schema' => ['description' => '备份Exchange。配置备份Exchange用于接收Exchange路由失败的消息。'."\n"
."\n", 'type' => 'string', 'required' => false, 'example' => 'DemoAE'],
],
],
'responses' => [
200 => [
'schema' => [
'type' => 'object',
'properties' => [
'RequestId' => ['description' => '请求ID。', 'type' => 'string', 'example' => '021788F6-E50C-4BD6-9F80-66B0A19A****'],
],
'description' => '',
],
],
],
'title' => '创建Exchange',
'requestParamsDescription' => ' ',
'responseParamsDescription' => ' ',
'extraInfo' => ' ',
'changeSet' => [
['createdAt' => '2024-07-11T08:42:21.000Z', 'description' => '请求参数发生变更'],
['createdAt' => '2024-03-19T03:50:07.000Z', 'description' => '请求参数发生变更'],
['createdAt' => '2023-11-03T02:39:26.000Z', 'description' => '错误码发生变更'],
],
'flowControl' => [
'flowControlList' => [
['threshold' => '10', 'countWindow' => 1, 'regionId' => '*', 'api' => 'CreateExchange'],
],
],
'ramActions' => [
[
'operationType' => 'create',
'ramAction' => [
'action' => 'amqp:CreateExchange',
'authLevel' => 'resource',
'actionConditions' => [],
'resources' => [
['validationType' => 'always', 'product' => 'Amqp', 'resourceType' => 'Exchange', 'arn' => 'acs:amqp:{#regionId}:{#accountId}:/instances/{#instanceId}/vhosts/{#vhostName}/exchanges/*'],
],
],
'additionalActions' => [
['action' => 'amqp:GetVhost'],
],
],
],
'responseDemo' => '[{"type":"json","example":"{\\n \\"RequestId\\": \\"021788F6-E50C-4BD6-9F80-66B0A19A****\\"\\n}","errorExample":""},{"type":"xml","example":"\\r\\n 021788F6-E50C-4BD6-9F80-66B0A19A6***\\r\\n","errorExample":""}]',
],
'CreateInstance' => [
'methods' => ['post'],
'schemes' => ['http', 'https'],
'security' => [
[
'AK' => [],
],
],
'operationType' => 'write',
'deprecated' => false,
'systemTags' => [
'operationType' => 'create',
'riskType' => 'high',
'chargeType' => 'paid',
'abilityTreeCode' => '194334',
'abilityTreeNodes' => ['FEATUREonsQ3252I'],
],
'parameters' => [
[
'name' => 'ClientToken',
'in' => 'query',
'schema' => ['title' => '客户端Token', 'description' => '客户端Token。', 'type' => 'string', 'required' => false, 'example' => 'c2c5d1274axxxxxxxx'],
],
[
'name' => 'PaymentType',
'in' => 'query',
'schema' => [
'title' => '付费类型',
'description' => '付费类型,取值如下:'."\n"
.'- Subscription:预付费系列'."\n"
.'- PayAsYouGo : Serverless系列',
'type' => 'string',
'required' => true,
'enumValueTitles' => ['PayAsYouGo' => 'PayAsYouGo', 'Subscription' => 'Subscription'],
'example' => 'Subscription',
'enum' => ['Subscription', 'PayAsYouGo'],
],
],
[
'name' => 'Period',
'in' => 'query',
'schema' => ['title' => '预付费周期,单位: periodCycle', 'description' => '预付费周期,单位:periodCycle。'."\n"
."\n"
.'> 当 PaymentType 为 Subscription 时,该参数有效,默认值为1。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1', 'default' => '1'],
],
[
'name' => 'PeriodCycle',
'in' => 'query',
'schema' => [
'title' => '预付费周期单位',
'description' => '预付费周期单位,取值如下:'."\n"
.'- Month:月'."\n"
.'- Year:年'."\n"
."\n"
.'当PaymentType为Subscription时,该参数有效,默认值为Month。',
'type' => 'string',
'required' => false,
'enumValueTitles' => ['Month' => 'Month', 'Year' => 'Year'],
'example' => 'Month',
'default' => 'Month',
'enum' => ['Month', 'Year', 'M', 'Y'],
],
],
[
'name' => 'AutoRenew',
'in' => 'query',
'schema' => ['title' => '续费方式', 'description' => '续费方式,取值如下:'."\n"
.'- true:自动续费'."\n"
.'- false:手动续费', 'type' => 'boolean', 'required' => false, 'example' => 'false', 'default' => 'false'],
],
[
'name' => 'AutoRenewPeriod',
'in' => 'query',
'schema' => ['title' => '自动续费周期,单位:月', 'description' => '自动续费周期,单位 RenewalDurationUnit 值,默认为:月。'."\n"
."\n"
.'> 当 AutoRenew 为 true 时,该参数有效,默认值为1 。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1', 'default' => '1'],
],
[
'name' => 'RenewStatus',
'in' => 'query',
'schema' => ['title' => 'autoRenew和renewStatus都是续费方式,当两个同时填写时,以renewStatus为准', 'description' => '续费状态,等同于 autoRenew ,二选1 配置即可,取值如下:'."\n"
.'- AutoRenewal: 自动续费'."\n"
."\n"
.'> 和renewStatus都是续费方式,当两个同时填写时,以renewStatus为准', 'type' => 'string', 'required' => false, 'example' => 'false'],
],
[
'name' => 'RenewalDurationUnit',
'in' => 'query',
'schema' => [
'description' => '自动续费周期单位,取值如下:'."\n"
.'- Month:月'."\n"
.'- Year:年',
'type' => 'string',
'required' => false,
'enumValueTitles' => ['Month' => 'Month', 'Year' => 'Year'],
'example' => 'Month',
],
],
[
'name' => 'InstanceType',
'in' => 'query',
'schema' => [
'title' => '实例规格类型',
'description' => '实例规格类型,'."\n"
.'预付费系列的取值如下:'."\n"
.'- professional:专业版'."\n"
.'- enterprise:企业版'."\n"
.'- vip:铂金版'."\n"
."\n"
.'Serverless系列实例:无需填写',
'type' => 'string',
'required' => false,
'enumValueTitles' => ['enterprise' => 'enterprise', 'vip' => 'vip', 'professional' => 'professional'],
'example' => 'professional',
'enum' => ['professional', 'enterprise', 'vip', 'serverless', 'provisioned'],
],
],
[
'name' => 'ServerlessChargeType',
'in' => 'query',
'schema' => [
'description' => 'Serverless系列实例的计费类型,取值如下:'."\n"
.'- onDemand:按量累计',
'type' => 'string',
'required' => false,
'example' => 'onDemand',
'enum' => ['onDemand', 'provisioned'],
],
],
[
'name' => 'InstanceName',
'in' => 'query',
'schema' => ['description' => '实例名称。建议长度不超过64个字符。', 'type' => 'string', 'required' => false, 'example' => 'amqp-xxxxx'],
],
[
'name' => 'MaxPrivateTps',
'in' => 'query',
'schema' => ['title' => '私网TPS流量,单位:次/秒', 'description' => '私网TPS流量,单位:次/秒。'."\n"
."\n"
.'请根据 “[云消息队列 RabbitMQ 版-购买页](https://common-buy.aliyun.com/?commodityCode=ons_onsproxy_pre)” 所给出的取值设置。', 'type' => 'integer', 'format' => 'int64', 'required' => false, 'example' => '1000'],
],
[
'name' => 'SupportEip',
'in' => 'query',
'schema' => ['title' => '是否支持公网', 'description' => '是否支持公网,取值如下:'."\n"
.'- true:支持公网'."\n"
.'- false:不支持公网', 'type' => 'boolean', 'required' => false, 'example' => 'true', 'default' => 'false'],
],
[
'name' => 'MaxEipTps',
'in' => 'query',
'schema' => ['title' => '公网网TPS流量峰值,单位:TPS', 'description' => '公网网TPS流量峰值,单位:TPS。'."\n"
."\n"
.'请根据 “[云消息队列 RabbitMQ 版-购买页](https://common-buy.aliyun.com/?commodityCode=ons_onsproxy_pre)” 所给出的取值设置。', 'type' => 'integer', 'format' => 'int64', 'required' => false, 'example' => '128', 'default' => '128'],
],
[
'name' => 'QueueCapacity',
'in' => 'query',
'schema' => ['title' => '配置Queue的数量上限', 'description' => '配置Queue的数量,单位:个。'."\n"
."\n"
.'请根据 “[云消息队列 RabbitMQ 版-购买页](https://common-buy.aliyun.com/?commodityCode=ons_onsproxy_pre)” 所给出的取值设置。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '1000'],
],
[
'name' => 'MaxConnections',
'in' => 'query',
'schema' => ['title' => '最大连接数', 'description' => '最大连接数。'."\n"
."\n"
.'请根据 “[云消息队列 RabbitMQ 版-购买页](https://common-buy.aliyun.com/?commodityCode=ons_onsproxy_pre)” 所给出的取值设置。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '50000'],
],
[
'name' => 'StorageSize',
'in' => 'query',
'schema' => ['title' => '配置消息存储空间', 'description' => '配置消息存储空间,单位: GB,取值如下:'."\n"
.'- 专业版实例和企业版实例:固定为0。'."\n"
."\n"
.'> 取值为0表示专业版和企业版实例不收取存储费用,而非没有存储空间。'."\n"
."\n"
.'- 铂金版实例:m×100,其中m的取值范围为\\[7,28\\]。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '7'],
],
[
'name' => 'SupportTracing',
'in' => 'query',
'schema' => ['title' => '是否开通消息轨迹功能', 'description' => '是否开通消息轨迹功能,取值如下:'."\n"
.'- true:开通消息轨迹功能'."\n"
.'- false:不开通消息轨迹功能'."\n"
."\n"
.'> - 铂金版实例免费提供15天消息轨迹功能,轨迹功能只能选择开启且轨迹保存时长只能设置为15天。'."\n"
.'- 其他规格类型实例可选择开启或关闭轨迹功能。', 'type' => 'boolean', 'required' => false, 'example' => 'true', 'default' => 'false'],
],
[
'name' => 'TracingStorageTime',
'in' => 'query',
'schema' => [
'title' => '配置消息轨迹的保存时长',
'description' => '配置消息轨迹的保存时长,单位:天,取值如下:'."\n"
.'- 3:3天'."\n"
.'- 7:7天'."\n"
.'- 15:15天'."\n"
."\n"
.'当SupportTracing为true时,该参数有效。',
'type' => 'integer',
'format' => 'int32',
'required' => false,
'example' => '3',
'enum' => ['3', '7', '15'],
],
],
[
'name' => 'ResourceGroupId',
'in' => 'query',
'schema' => ['description' => '实例所属资源组ID。', 'type' => 'string', 'required' => false, 'example' => 'rg-acfmvvajg5qkxhi'],
],
[
'name' => 'EncryptedInstance',
'in' => 'query',
'schema' => ['title' => '是否开通磁盘存储加密', 'description' => '独享实例专属功能。实例是否开通数据存储加密功能。', 'type' => 'boolean', 'required' => false, 'example' => 'false', 'default' => 'false'],
],
[
'name' => 'KmsKeyId',
'in' => 'query',
'schema' => ['title' => 'kms Key Id', 'description' => '独享实例专属功能,当EncryptedInstance为true时需要填写此字段。 数据加密存储使用的KMS密钥ID。 对密钥有以下要求:'."\n"
."\n"
.'- 不能是服务密钥;'."\n"
."\n"
.'- 密钥状态必须是开启的;'."\n"
."\n"
.'- 必须是对称密钥,不能是非对称密钥;'."\n"
."\n"
.'- 密钥用途必须是加解密;'."\n"
."\n"
.'- KMS密钥过期/删除后,数据读写不可用,RabbitMQ实例异常;', 'type' => 'string', 'required' => false, 'example' => 'key-xxx'],
],
[
'name' => 'ProvisionedCapacity',
'in' => 'query',
'schema' => ['description' => '预留+弹性实例的预留TPS容量。', 'type' => 'integer', 'format' => 'int32', 'required' => false, 'example' => '2000'],
],
[
'name' => 'Edition',
'in' => 'query',
'schema' => [
'description' => 'Serverless实例部署架构,取值如下:'."\n"
."\n"
.'- shared: 共享架构,适用预留+弹性(共享)以及按量付费版本。'."\n"
."\n"
.'- dedicated:独享架构,适用预留+弹性(独享)版本。',
'type' => 'string',
'required' => false,
'example' => 'shared',
'enum' => ['shared', 'dedicated'],
],
],
[
'name' => 'Tags',
'in' => 'query',
'style' => 'json',
'schema' => [
'title' => '资源标签',
'description' => '资源标签',
'type' => 'array',
'items' => [
'title' => '标签对象',
'description' => '标签对象',
'type' => 'object',
'properties' => [
'Key' => ['title' => '资源标签健', 'description' => '资源标签健', 'type' => 'string', 'required' => false, 'example' => 'testKey'],
'Value' => ['title' => '资源标签值', 'description' => '资源标签值', 'type' => 'string', 'required' => false, 'example' => 'testValue'],
],
'required' => false,
],
'required' => false,
],
],
[
'name' => 'VpcId',
'in' => 'query',
'schema' => ['title' => '用户指定vpcId,用于创建PVL接入点。', 'description' => '用户指定vpcId,用于创建PVL接入点。', 'type' => 'string', 'required' => true, 'example' => 'vpc-xxx'],
],
[
'name' => 'VswitchIds',
'in' => 'query',
'style' => 'json',
'schema' => [
'title' => '创建实例时,用于创建privateLink接入点参数。必须为两个(除个别单可用区地域外)。',
'description' => '创建实例时,用于创建privateLink接入点。'."\n"
."\n"
.'1. 必须为两个,且属于不同可用区(除个别单可用区地域外);'."\n"
."\n"
.'2. vswitch需要属于指定的VPC;'."\n"
.' '."\n"
.'3. vswitch状态需要为Available;'."\n"
."\n"
.'4. vswitch中可用IP个数不能少于20;'."\n"
."\n"
.'5. vswitch所属可用区必须支持创建NLB;',
'type' => 'array',
'items' => ['title' => '创建实例时填写的vswitchId ', 'description' => '创建实例时填写的vswitchId ', 'type' => 'string', 'required' => true, 'example' => 'vsw-xxx'],
'required' => true,
'maxItems' => 2,
'minItems' => 1,
],
],
[
'name' => 'SecurityGroupId',
'in' => 'query',
'schema' => ['title' => '指定安全组,用户创建pvl接入点。不能使用托管安全组。', 'description' => '指定安全组,用于创建privatelink接入点。'."\n"
."\n"
.'1. 访问策略增加运行入方向写协议类型为TCP,目的地端口为5672, 5671的策略;'."\n"
."\n"
.'2. 不支持托管安全组;'."\n"
."\n"
.'3. 安全组需要属于指定的VPC;', 'type' => 'string', 'required' => true, 'example' => 'sg-xxx'],
],
[
'name' => 'ListenerMode',
'in' => 'query',
'schema' => [
'title' => '指定实例是否只开通TLS加密传输端口。此参数仅在(独享)预留+弹性、铂金实例支持。',
'description' => '指定实例是否只开通TLS加密传输端口。此参数仅在(独享)预留+弹性、铂金实例支持。',
'type' => 'string',
'required' => false,
'example' => 'tcp_and_ssl',
'default' => 'tcp_and_ssl',
'enum' => ['tcp_and_ssl', 'ssl_only'],
],
],
[
'name' => 'AuthModel',
'in' => 'query',
'schema' => ['type' => 'string', 'example' => 'ram openSource'],
],
[
'name' => 'ServerlessSwitch',
'in' => 'query',
'schema' => ['type' => 'boolean'],
],
],
'responses' => [
200 => [
'schema' => [
'title' => 'JsonResult