# 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.

<table><thead><tr><th width="192">Parameter Name</th><th width="118">Required</th><th width="116">Type</th><th>Description</th></tr></thead><tbody><tr><td>pageNum</td><td>No</td><td>Integer</td><td><p>Number of pages returned.</p><p>Default value: 1</p></td></tr><tr><td>pageSize</td><td>No</td><td>Integer</td><td><p>Number of items in the current page result.</p><p>Default value: 20</p></td></tr><tr><td>resourceGroupId</td><td>Yes</td><td>String</td><td>Resource group ID.</td></tr><tr><td>resourceType</td><td>No</td><td>String</td><td>Resource type. You can obtain <code>resourceType</code> from the output parameter of <a href="describeresourcetypes"><code>DescribeResourceTypes</code></a>.</td></tr><tr><td>updateTimeSort</td><td>No</td><td>String</td><td><p>Sorting methods of updated time.</p><ul><li><code>ascend</code></li><li><code>descend</code></li></ul><p>Default value: <code>descend</code>.</p></td></tr></tbody></table>

## 3. Output Parameters

<table><thead><tr><th width="190">Parameter Name</th><th width="198">Type</th><th>Description</th></tr></thead><tbody><tr><td>requestId</td><td>String</td><td>The unique request ID, which is returned for each request. RequestId is required for locating a problem.</td></tr><tr><td>pageNum</td><td>Integer</td><td>Page number.</td></tr><tr><td>pageSize</td><td>Integer</td><td>Number of items in the current page result.</td></tr><tr><td>total</td><td>Integer</td><td>Number of resources meeting the filtering conditions.</td></tr><tr><td>list</td><td>Array of <a href="../../datastructure#resourceinfo">ResourceInfo</a></td><td>Information on resources.</td></tr></tbody></table>

## 4. Code Example

{% tabs %}
{% tab title="Example" %}
**Query information on resources under resource group.**

```json
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"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

## 5. Developer Resources <a href="#id-5.-kai-fa-zhe-gong-ju" id="id-5.-kai-fa-zhe-gong-ju"></a>

Zenlayer Cloud API 2.0 integrates [SDKs](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/software-toolkit/sdk) 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](https://docs.console.zenlayer.com/test/ci-develop-en/api-introduction/instruction/commonerrorcode).​​

<table><thead><tr><th width="200">HTTP Status Code</th><th width="284">Error Code</th><th>Description</th></tr></thead><tbody><tr><td>404</td><td>INVALID_RESOURCE_GROUP_ID</td><td>Resource group does not exist.</td></tr></tbody></table>
