弹性伸缩 AS-查询资源实例:请求示例

时间:2024-07-22 11:16:34

请求示例

  • 查询租户下按包含标签key=key1,value=value1,不包含key=key2,value=value2,索引位置100,查询最大记录数为100的伸缩组资源信息,action为filter。
    POST https: //{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/resource_instances/action
    
    {
    	"offset": "100",
    	"limit": "100",
    	"action": "filter",
    	"matches": [{
    		"key": "resource_name",
    		"value": "resource1"
    	}],
    	"not_tags": [{
    		"key": "key2",
    		"values": ["value2"]
    	}],
    	"tags": [{
    		"key": "key1",
    		"values": ["value1"]
    	}]
    }
  • 查询租户下按包含标签key=key1,value=value1,不包含key=key2,value=value2的伸缩组资源数目,action为count。
    POST https: //{Endpoint}/autoscaling-api/v1/{project_id}/scaling_group_tag/resource_instances/action
    
    {
    	"action": "count",
    	"not_tags": [{
    		"key": "key2",
    		"values": ["value2"]
    	}],
    	"tags": [{
    		"key": "key1",
    		"values": ["value1"]
    	}],
    	"matches": [{
    		"key": "resource_name",
    		"value": "resource1"
    	}]
    }
support.huaweicloud.com/api-as/as_06_1004.html