根据标签查询负载均衡器ListLoadbalancersByTags
功能介绍
根据标签过滤查询 负载均衡 实例。
接口约束
无。
URI
POST /v2.0/{project_id}/loadbalancers/resource_instances/action
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
project_id |
是 |
String |
标签所在的项目ID。 获取方法详见获取项目ID。 |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Auth-Token |
是 |
String |
用户token |
响应参数
请求示例
- 请求样例1 action为filter时的请求体
POST https://{Endpoint}/v2.0/6a0de1c3-7d74-4f4a-b75e-e57135bd2b97/loadbalancers/resource_instances/action { "offset": "100", "limit": "100", "action": "filter", "matches": [ { "key": "resource_name", "value": "resource1" } ], "tags": [ { "key": "key1", "values": [ "*value1", "value2" ] } ] }
- 请求样例2 action为count时的请求体
POST https://{Endpoint}/v2.0/6a0de1c3-7d74-4f4a-b75e-e57135bd2b97/loadbalancers/resource_instances/action { "action": "count", "tags": [ { "key": "key1", "values": [ "value1", "value2" ] }, { "key": "key2", "values": [ "value1", "value2" ] } ], "matches": [ { "key": "resource_name", "value": "resource1" } ] }
响应示例
- 响应样例1 action为filter时响应体
{ "resources": [ { "resource_detail": "", "resource_id": "154d135b-3a89-4e89-8023-06efb9acdc05", "resource_name": "resouece1", "tags": [ { "key": "key1", "value": "value1" }, { "key": "key2", "value": "value1" } ] } ], "total_count": 1000 }
- 响应样例2 action为count时响应体
{ "total_count": 1000 }
返回码
请参见返回码。