镜像服务 IMS-按标签查询镜像:请求示例

时间:2024-11-13 14:59:39

请求示例

  • 按照标签和总条数返回查询条件,查询镜像。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    POST https://{Endpoint}/v2/fd73a4a14a4a4dfb9771a8475e5198ea/images/resource_instances/action
    {
       "action": "count",
       "matches": [{
          "key": "resource_name",
          "value": "test100"
       }],
       "tags": [
       {
          "key": "key3",
          "values": ["valueXX"]
       }],
       "tags_any": [
       {
          "key": "key0",
          "values": ["valueXX"]
       }],
          "not_tags": [
       {
          "key": "key9",
          "values": ["value9"]
       }],
       "not_tags_any": [{
          "key": "key7",
          "values": ["value7"]
       }]
    }
    
  • 按照标签和分页查询条件,查询镜像。
     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    POST https://{Endpoint}/v2/fd73a4a14a4a4dfb9771a8475e5198ea/images/resource_instances/action
    {
       "action": "filter",
       "limit": "1",
       "offset": "0",
       "matches": [{
          "key": "resource_name",
          "value": "test100"
       }],
       "tags": [
       {
          "key": "key3",
          "values": ["valueXX"]
       }],
       "tags_any": [
       {
          "key": "key0",
          "values": ["valueXX"]
       }],
       "not_tags": [
       {
          "key": "key9",
          "values": ["value9"]
       }],
       "not_tags_any": [{
          "key": "key7",
          "values": ["value7"]
       }]
    }
    
support.huaweicloud.com/api-ims/ims_03_0616.html