1.接口协议:
POST https://[endpoint].ctapi.ctyun.cn/v2/binding/create
请求参数 | 是否必填 | 位置 | 参数类型 | 说明 |
prodInstId | 是 | json | String | 实例ID |
destination_type | 是 | json | String | 绑定目标类型,交换机:e,队列q |
source | 是 | json | String | 绑定来源交换器名称(交换机需存在) |
destination | 是 | json | String | 绑定目标名称取值如下: destination_type=e 交换机名称 destination_type=q 队列名称 (需存在)
|
vhost | 是 | json | String | vhost名称 |
routing_key | 否 | json | String | 路由键 |
arguments | 否 | json | Map | 绑定参数。该参数仅用于headers类型交换机,此时必须包括键x-match,可选值有all、any。 |
响应参数 | 参数类型 | 描述 |
statusCode | String | 接口系统层面状态码。成功:800,失败:900 |
message | String | 描述状态 |
returnObj | String | 返回对象。此参数所包含的参数请见“响应示例"里面的注释 |
2.请求示例:
POST https://[endpoint].ctapi.ctyun.cn/v2/binding/create
{
"prodInstId": "9b9bea76b7ce412ca18f99ccc1ea717b",
"source": "test",
"destination_type": "q",
"destination": "qu1",
"routing_key": "qqq",
"vhost": "/"
}
3.返回示例:
成功响应示例
{
"returnObj": {
"data": null
},
"message": "success",
"statusCode": "800"
}
失败响应示例
{
"returnObj": {
"data": "{\"error\":\"not_found\",\"reason\":\"vhost_not_found\"}"
},
"message": "...",
"statusCode": "900"
}