Querying All Resources of a User
Function
This API is used to query all resources of a user.
-
The information about all resources of a tenant can help the tenant learn about the overall resource status.
-
The request parameters provider (cloud service name), type (cloud resource type), and limit (number of records) are mandatory. The maximum number of records that can be queried at a time is 200.
Authorization Information
Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.
- If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
- If you are using identity policy-based authorization, the following identity policy-based permissions are required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
coc:instance:listResources
List
-
-
-
-
URI
GET /v1/external/resources
Request Parameters
None
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Definition: Request ID used for task tracing. Value range: request_uuid-timestamp-host name. |
|
Parameter |
Type |
Description |
|---|---|---|
|
data |
Array of data objects |
Definition: Resource list. Value Range: The value ranges from 0 to 500. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Resource ID allocated by CloudCMDB. Value Range: N/A |
|
resource_id |
String |
Definition: ID of the resource allocated by the cloud service. Value Range: The value is a string with 36 characters. |
|
domain_id |
String |
Definition: Tenant ID. Value Range: N/A |
|
name |
String |
Definition: Resource name. Value Range: The value is a string with 3 to 50 characters. |
|
provider |
String |
Definition: Cloud service name Value Range: The value is a string with 1 to 64 characters. |
|
type |
String |
Definition: Resource type. Options: Value Range: There are many resource types. Select a resource type based on the actual service. The common resource types are as follows: |
|
project_id |
String |
Definition: Project ID in OpenStack. Value Range: The value is a string with 32 characters. |
|
project_name |
String |
Definition: Sub-project name of a region. Value Range: The value is a string with a maximum of 255 characters. |
|
region_id |
String |
Definition: Region ID. Value Range: The value is a string with 0 to 64 characters. |
|
ep_id |
String |
Definition: Enterprise project ID. Value Range: Select a project ID that exists inEnterprise Management. |
|
ep_name |
String |
Definition: Enterprise project name. Value Range: The value can contain a maximum of 255 characters, including letters, digits, underscores (_), and hyphens (-). The value cannot be "default" in any case. |
|
tags |
Object |
Definition: Resource tag. Value Range: N/A |
|
agent_id |
String |
Definition: ID of the UniAgent. Value Range: N/A |
|
agent_state |
String |
Definition: UniAgent status. Value Range: |
|
properties |
Object |
Definition: Resource attributes. Value Range: N/A |
|
ingest_properties |
Map<String,String> |
Definition: Collection attribute. Value Range: N/A |
|
is_delegated |
Boolean |
Definition: Hosted Value Range: |
|
inner_ip |
String |
Definition: Internal IP address of the resource. Value Range: N/A |
|
operable |
Boolean |
Definition: Users can define whether O&M can be performed on a resource. Value Range: |
|
is_associate_group |
Boolean |
Definition: Whether the resource has been associated with a specified group. Value Range: |
|
associated_group_list |
Array of strings |
Definition: List of groups associated with a resource. Value Range: N/A |
|
create_time |
String |
Definition: Creation time. The value is in the ISO 8601 format. Value Range: N/A |
|
update_time |
String |
Definition: Modification time. The value is in the ISO 8601 format. Value Range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Tag key. Value range: The tag key cannot start or end with a space, or start with sys. It can contain letters, digits, spaces, and the following special characters: _.:=+-@. A maximum of 128 characters are allowed. |
|
value |
String |
Definition: Tag value. Value range: A tag value can contain a maximum of 255 characters. It cannot start or end with a space. Only letters, digits, spaces, and the following special characters are allowed: _ . : / = + - @ |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
X-request-id |
String |
Definition: Request ID used for task tracing. Value range: request_uuid-timestamp-host name. |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Error code. Value range: The value contains 8 to 36 characters. |
|
error_msg |
String |
Definition: Error description. Value range: The value contains 2 to 512 characters. |
Example Requests
This API is used to query all resources of a user.
GET https://{Endpoint}/v1/external/resources?limit=10&offset=0&type=cloudservers&provider=ecs&is_collected=true
Example Responses
Status code: 200
Querying all resources of the user succeeded.
{
"data" : [ {
"id" : "6891f55f1c083f512c6b222c",
"resource_id" : "37b64b7c-cdc9-4c2b-8f34-b8fa450bfbd2",
"name" : "auto-script-runbook-0005-0003",
"ep_id" : "0",
"ep_name" : "default",
"project_id" : "10a6c23c2a1044779794798beb067c94",
"project_name" : "testregion",
"domain_id" : "dc2d76541f754d68a4c8d150262d92c2",
"provider" : "ecs",
"type" : "cloudservers",
"region_id" : "testregion",
"tags" : [ {
"key" : "_sys_type_hcss_x",
"value" : ""
} ],
"properties" : {
"accessIpv4" : "",
"hostName" : "auto-script-runbook-0005-0003",
"addresses" : [ {
"OsExtIpsType" : "fixed",
"OsExtIpsPortId" : "05f5d9db-bb16-404a-a2a5-a5969942f330",
"addr" : "192.168.3.104",
"version" : 4,
"OsExtIpsMacAddr" : "fa:16:3e:a3:fe:63",
"primary" : true
} ],
"accessIpv6" : "",
"metadata" : {
"chargingMode" : "0",
"meteringImageType" : "gold",
"imageName" : "CentOS 7.5 64bit",
"meteringImageId" : "e0adce3a-a4d2-4207-9018-69ce64b4426a",
"meteringResourcesPerCode" : "x1.1u.1g.linux",
"vpcId" : "7a7087df-cca1-4fab-9aae-c2105a1a49fb",
"osBit" : "64",
"osType" : "Linux"
},
"OsExtStsVmState" : "active",
"configDrive" : "",
"OsExtStsPowerState" : 1,
"hostId" : "52db359758486a662c841d888b49d0d0a184208e497e2a0eb0f065f7",
"securityGroup" : [ {
"name" : "default",
"id" : "9e262f72-2f9a-4534-8a56-412710913895"
} ],
"ExtVolumesAttached" : [ {
"bootIndex" : "0",
"id" : "3bd6d353-979e-43d8-8936-ce2e246d79fd",
"device" : "/dev/vda"
} ],
"userId" : "a0ea25cd3a7549208e93971d80424481",
"flavor" : {
"disk" : "0",
"name" : "x1.1u.1g",
"id" : "x1.1u.1g",
"vcpus" : "1",
"ram" : "1024"
},
"osextsrvattr" : {
"hostName" : "auto-script-runbook-0005-0003",
"kernelId" : "",
"ramdiskId" : "",
"reservationId" : "r-hnvhg2wd",
"instanceName" : "instance-013ea14f",
"host" : "52db359758486a662c841d888b49d0d0a184208e497e2a0eb0f065f7",
"rootDeviceName" : "/dev/vda",
"hypervisorHostName" : "52db359758486a662c841d888b49d0d0a184208e497e2a0eb0f065f7",
"launchIndex" : 0
},
"OsDcfDiskConfig" : "MANUAL",
"hostStatus" : "UP",
"OsSrvUsgLaunchedAt" : "2025-08-05T07:14:07.000000",
"OsExtAz" : "test11",
"progress" : 0,
"locked" : false,
"status" : "ACTIVE",
"schedulerHints" : { }
},
"ingest_properties" : null,
"agent_id" : "9cf256e04bbe49f89593cfb66a3b5956",
"agent_state" : "ONLINE",
"inner_ip" : "192.168.3.104",
"is_delegated" : null,
"operable" : null,
"is_associate_group" : null,
"associated_group_list" : null,
"create_time" : "2025-08-05T07:13:55.000+00:00",
"update_time" : "2025-08-05T08:04:05.000+00:00"
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Querying all resources of the user succeeded. |
|
400 |
Failed to query all resources of the user. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot