DescribeResourcesByGroup

1. API Description

This API is used to query information on resources under a certain resource group.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

pageNum

No

Integer

Number of pages returned.

Default value: 1

pageSize

No

Integer

Number of items in the current page result.

Default value: 20

resourceGroupId

Yes

String

Resource group ID.

resourceType

No

String

Resource type. You can obtain resourceType from the output parameter of DescribeResourceTypes.

updateTimeSort

No

String

Sorting methods of updated time.

  • ascend

  • descend

Default value: descend.

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

pageNum

Integer

Page number.

pageSize

Integer

Number of items in the current page result.

total

Integer

Number of resources meeting the filtering conditions.

list

Array of ResourceInfo

Information on resources.

4. Code Example

Query information on resources under resource group.

POST /api/v2/user HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: DescribeResourcesByGroup
<Common Request Params>

Request:
{
    "pageNum":1,
    "pageSize":20,
    "resourceGroupId":"c91db3f4-b15e-4323-9a12-fd3f0330b74b",
    "resourceType":"ZGA_ACCELERATOR",
    "updateTimeSort":null
}

Response:
{
    "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
    "response": {
        "requestId": "TEEFDCA5B-76FB-4E91-A18E-DF7F5D2CE41F",
        "pageNum": 1,
        "pageSize": 20,
        "total": 2,
        "list": [
            {
                "resourceId":"1069322610690759681",
                "name":"www.uu.test_United States",
                "aliasName":"www.uu.test_United States",
                "resourceType":"ZGA_ACCELERATOR",
                "createTime":"2024-01-15T09:13:09Z",
                "updateTime":"2024-01-15T09:13:09Z"
            },
            {
                "resourceId":"1010516689890323201",
                "name":"www.testzga.com_United States",
                "aliasName":"www.testzga.com_United States",
                "resourceType":"ZGA_ACCELERATOR",
                "createTime":"2023-10-26T05:56:17Z",
                "updateTime":"2023-10-26T05:56:17Z"
            }
        ]
    }
}

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​​

HTTP Status Code
Error Code
Description

404

INVALID_RESOURCE_GROUP_ID

Resource group does not exist.

Last updated