Get resource list by tag - ListResourcesByLabels
Overview
Get resource list by tag
Definition
Public Parameters
| Parameter Name | Type | Description Information | Required | 
|---|---|---|---|
| Action | string | Corresponding API command name, the current API is ListResourcesByLabels. | Yes | 
| PublicKey | string | The user’s public key can be obtained from Console  | Yes | 
| Signature | string | User signature generated based on public key and API command, see Signature Algorithm | Yes | 
Request Parameters
| Parameter Name | Type | Description Information | Required | 
|---|---|---|---|
| Labels.N.Key | string | Tag Key | Yes | 
| Labels.N.Value | string | Tag Value | Yes | 
| ResourceTypes.N | string | Resource Type Array | Yes | 
| ProjectIds.N | string | Project ID Array | Yes | 
| Offset | int | List start position offset, default is 0 | No | 
| Limit | int | Return data length, default is 0, maximum 100 | No | 
Response Field
| Field Name | Type | Description Information | Required | 
|---|---|---|---|
| RetCode | int | Return status code. If it is 0, it means successful return. If it is not 0, it means failure. | Yes | 
| Action | string | Operation command name. | Yes | 
| Message | string | Returns an error message, providing detailed description when RetCodeis non-zero. | No | 
| TotalCount | int | Total Resources | No | 
| Resources | array[ListResourcesByLabelsResource] | Resource List | No | 
Data Model
ListResourcesByLabelsResource
| Field Name | Type | Description Information | Required | 
|---|---|---|---|
| ProjectId | string | Project ID | Yes | 
| ResourceId | string | Resource ID | Yes | 
| ResourceName | string | Resource Name | Yes | 
| ProjectName | string | Project Name | Yes | 
| ResourceType | string | Resource Type | Yes | 
| Labels | array[ListResourcesByLabelsLabel] | Tag Array | Yes | 
ListResourcesByLabelsLabel
| Field Name | Type | Description Information | Required | 
|---|---|---|---|
| Key | string | Tag Key | No | 
| Value | string | Tag Value | No | 
| Category | string | Tag type, system: System tag; custom: Custom tag | No | 
Example
Request Example
https://api.surfercloud.com/?Action=ListResourcesByLabels
&Labels=ntCdGAyy
&Offset=2
&Limit=3
&Labels.N.Value=YXDLevRF
&ResourceTypes.N=UuUvHKWO
&ProjectIds.N=XgLtzEFfResponse Example
{
  "Action": "ListResourcesByLabelsResponse",
  "Resources": [
    {
      "Labels": [
        {
          "Category": "lKEsvGZE",
          "Key": "ZIUFsoXl",
          "Value": "JWILJdgN"
        }
      ],
      "ProjectId": "ndAdjmsF",
      "ProjectName": "aNXZWXmR",
      "Region": "fsAJwsSj",
      "ResourceId": "NAVCNQVl",
      "ResourceName": "zQRrbpKU",
      "ResourceType": "iWNdsqXo",
      "Zone": "NcjklQqz"
    }
  ],
  "RetCode": 0,
  "TotalCount": 8
}