Querying Resources in a Resource Group
Function
This API is used to query resources in a resource group by resource group ID. This API has been deprecated. You are advised to use the V2 APIs. For details, see Querying Resources of a Specified Dimension for a Specified Service Type in a Resource Group.
URI
GET /V1.0/{project_id}/resource-groups/{group_id}
Parameter | Mandatory | Type | Description |
|---|---|---|---|
project_id | Yes | String | Definition Project ID. It is used to specify the project that an asset belongs to. You can query the assets of a project by project ID. You can obtain the project ID from the API or console. For details, see Obtaining a Project ID. Constraints N/A Range 1 to 64 characters Default Value N/A |
group_id | Yes | String | Definition Resource group ID. Constraints N/A Range The value starts with rg and is followed by 22 characters of letters, digits, or a combination of both. Default Value N/A |
Parameter | Mandatory | Type | Description |
|---|---|---|---|
status | No | String | Definition Health status of a resource group. Constraints N/A Range
Default Value N/A |
namespace | No | String | Definition Resource type, that is, namespace. For example, the namespace of an ECS is SYS.ECS. For the namespace of each service, see the Service Namespaces. Constraints N/A Range The value is in the service.item format. The values of service and item must be a string, starting with a letter and containing only digits (0–9), letters (case-insensitive), and underscores (_). The value can include 3 to 32 characters. Default Value N/A |
dname | No | String | Definition Resource dimension. For example, the dimension of an ECS is instance_id. For the dimension of each service, see the Service Metric Dimensions. Constraints N/A Range The value allows 1 to 131 characters. It can include letters, digits, underscores (_), hyphens (-), slashes (/), number signs (#), backslashes (), and parentheses. Default Value N/A |
start | No | String | Definition Pagination start value. Constraints N/A Range [0,9999999] Default Value 0 |
limit | No | String | Definition Maximum number of records that can be queried at a time. Constraints N/A Range [1,100] Default Value 100 |
Request Parameters
Parameter | Mandatory | Type | Description |
|---|---|---|---|
Content-Type | No | String | Definition MIME type of the request body. Constraints N/A Range 1 to 64 characters Default Value Default value application/json; charset=UTF-8 is recommended. For APIs used to upload objects or images, the MIME type varies with the flow type. |
X-Auth-Token | No | String | Definition User token. Constraints N/A Range 1 to 16,384 characters Default Value N/A |
Response Parameters
Status code: 200
Parameter | Type | Description |
|---|---|---|
group_name | String | Definition Resource group name. Constraints N/A Range The value allows 1 to 128 characters. It can only contain letters, digits, hyphens (-), and underscores (_). Default Value N/A |
group_id | String | Definition Resource group ID. Constraints N/A Range The value starts with rg and is followed by 22 characters that may include letters, digits, or a combination of both. It can contain 2 to 24 characters. Default Value N/A |
resources | Array of ResourceGroup objects | Definition One or more resources selected for the resource group to be created. Constraints A maximum of 1,000 resources are allowed. |
status | String | Definition Health status of a resource group. Constraints N/A Range
Default Value N/A |
create_time | Long | Definition Time when the resource group was created. The value is a UNIX timestamp in milliseconds. Example: 1603819753000. Constraints N/A Range [1,9223372036854775807] Default Value N/A |
meta_data | MetaData object | Metadata of query results, including the pagination information. |
enterprise_project_id | String | Definition Enterprise project associated with the resource group upon its creation. The default value 0 indicates that the enterprise project default is associated with the resource group. Constraints N/A Range The value can be 0 (default enterprise project ID) or consists of digits, letters, or hyphens (-). Default Value N/A |
Parameter | Type | Description |
|---|---|---|
namespace | String | Definition Resource type, that is, namespace. For example, the namespace of an ECS is SYS.ECS. For the namespace of each service, see the Service Namespaces. Constraints N/A Range The value is in the service.item format. The values of service and item must be a string, starting with a letter and containing only digits (0–9), letters (case-insensitive), and underscores (_). Default Value N/A |
dimensions | Array of MetricsDimension objects | Definition Resource dimension information. Constraints A maximum of four dimensions are allowed. |
status | String | Definition Health status of a resource group. Constraints N/A Range
Default Value N/A |
event_type | Integer | Event type. The default value is 0. |
Parameter | Type | Description |
|---|---|---|
name | String | Definition Dimension of a resource. For example, the dimension of an ECS can be instance_id. A maximum of four dimensions are supported. For the metric dimension of each resource, see Service Metric Dimensions. Constraints N/A Range The value starts with a letter and allows 1 to 32 characters. It can contain letters, digits, underscores (_), and hyphens (-). Default Value N/A |
value | String | Definition Resource dimension value, which is an instance ID, for example, 4270ff17-aba3-4138-89fa-820594c39755. Constraints N/A Range 1 to 256 characters Default Value N/A |
Parameter | Type | Description |
|---|---|---|
count | Integer | Definition Number of records that can be returned. Constraints N/A Range [0,2147483647] Default Value N/A |
total | Integer | Definition Total number of records. Constraints N/A Range [0,2147483647] Default Value N/A |
marker | String | Definition Start of the next page, which is used for pagination. Constraints N/A Range [1,9999] Default Value N/A |
Status code: 400
Parameter | Type | Description |
|---|---|---|
- | String | Request error. |
Status code: 401
Parameter | Type | Description |
|---|---|---|
- | String | The authentication information is not provided or is incorrect. |
Status code: 403
Parameter | Type | Description |
|---|---|---|
- | String | Access to the requested page is forbidden. |
Status code: 408
Parameter | Type | Description |
|---|---|---|
- | String | The request timed out. |
Status code: 429
Parameter | Type | Description |
|---|---|---|
- | String | Too many requests. |
Status code: 500
Parameter | Type | Description |
|---|---|---|
- | String | Failed to complete the request because of an internal service error. |
Status code: 503
Parameter | Type | Description |
|---|---|---|
- | String | The system is currently unavailable. |
Example Requests
/V1.0/{project_id}/resource-groups/rg16044763786104XvXvl00a Example Responses
Status code: 200
OK
{
"group_name" : "ResourceGroup-Test-01",
"resources" : [ {
"namespace" : "SYS.ECS",
"dimensions" : [ {
"name" : "instance_id",
"value" : "6cffb0bd-fd37-400f-ae6f-8f4be021ff7e"
} ],
"status" : "health",
"event_type" : 0
}, {
"namespace" : "SYS.ECS",
"dimensions" : [ {
"name" : "instance_id",
"value" : "e37d6238-9dd3-4720-abcc-eb9f8fb08ca0"
} ],
"status" : "health",
"event_type" : 0
} ],
"create_time" : 1604476378000,
"group_id" : "rg16044763786104XvXvl00a",
"status" : "health",
"meta_data" : {
"count" : 0,
"marker" : "",
"total" : 2
},
"enterprise_project_id" : "0"
} Status Codes
Status Code | Description |
|---|---|
200 | OK |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
408 | Request Timeout |
429 | Too Many Requests |
500 | Internal Server Error |
503 | Service Unavailable |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.

