数据接入服务 DIS-使用标签过滤资源(通道等):请求示例

时间:2024-10-21 14:17:50

请求示例

  • 使用标签过滤资源(通道等),查询记录总数。

    POST https://{Endpoint}/v2/{project_id}/stream/resource_instances/action
    
    {
      "action" : "count",
      "tags" : [ {
        "key" : "key1",
        "values" : [ "value1", "value2" ]
      }, {
        "key" : "key2",
        "values" : [ "value1", "value2" ]
      } ],
      "matches" : [ {
        "key" : "resource_name",
        "value" : "resource1"
      } ]
    }
  • 使用标签过滤资源(通道等),分页查询。

    POST https://{Endpoint}/v2/{project_id}/stream/resource_instances/action
    
    {
      "offset" : "0",
      "limit" : "100",
      "action" : "filter",
      "matches" : [ {
        "key" : "resource_name",
        "value" : "resource1"
      } ],
      "tags" : [ {
        "key" : "key1",
        "values" : [ "*value1", "value2" ]
      } ]
    }
support.huaweicloud.com/api-dis/ListResourcesByTags.html