Updated on 2025-12-05 GMT+08:00

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.

URI

GET /v1/external/resources

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

provider

Yes

String

Definition

Cloud service name.

Constraints

  • If the number of created cloud resources (value of the count field) is greater than 1, you can use Auto Sort and Regular Sort to set the names of ordered cloud resources.

  • If the number of created cloud resources (the value of count) is greater than 1, the system automatically adds a mark similar to -0000 to the end of each cloud resource name to differentiate cloud resources. If you specify a number, the name of the first new resource will start from the specified number. In this case, the name contains 1 to 59 characters.

Range

The value can contain 1 to 128 characters, including only letters, digits, underscores (_), hyphens (-), and periods (.).

Default value

N/A

type

Yes

String

Definition

Resource type.

Constraints

N/A

Range

There are many resource types. Select a resource type based on the actual service. The common resource types are as follows:

  • cloudservers: Elastic Cloud Servers (ECSs)

  • servers: Bare Metal Servers (BMSs)

  • clusters: Cloud Container Engine (CCE)

  • instances: cloud database instances

Default value

N/A

limit

Yes

Integer

Definition

Number of items displayed on each page when the pagination query is performed.

Constraints

N/A

Range

The value can be customized. The value range is 1 to 500.

Default value

N/A

marker

No

String

Definition

It is used for pagination query.

Constraints

N/A

Range

Pagination parameter. You can use the marker value returned in the previous request as the number of the first page of records to return in this request.

Default value

N/A

resource_id_list

No

Array of strings

Definition

Resource ID list.

Constraints

N/A

Range

Resource ID list. The maximum value is 100.

Default value

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response header parameters

Parameter

Type

Description

X-request-id

String

Definition

Request ID used for task tracing.

Range

request_uuid-timestamp-host_name.

Table 3 Response body parameters

Parameter

Type

Description

data

Array of data objects

Definition

Resource list.

Range

The value range is 0 to 500.

Table 4 data

Parameter

Type

Description

id

String

Definition

Resource ID allocated by CloudCMDB.

Range

N/A

resource_id

String

Definition

ID of the resource allocated by the cloud service.

Range

The value is a string. It contains 36 characters.

domain_id

String

Definition

Tenant ID.

Range

N/A

name

String

Definition

Resource name.

Range

The value is a string. It contains 3 to 50 characters.

provider

String

Definition

Cloud service name.

Range

The value is a string. It contains 1 to 64 characters.

type

String

Definition

Resource type.

Range

There are many resource types. Select a resource type based on the actual service. The common resource types are as follows:

  • cloudservers: Elastic Cloud Servers (ECSs)

  • servers: Bare Metal Servers (BMSs)

  • clusters: Cloud Container Engine (CCE)

  • instances: cloud database instances

project_id

String

Definition

Project ID in OpenStack.

Range

The value is a string. It contains 32 characters.

project_name

String

Definition

Name of the sub-project of a region.

Range

The value is a string. It contains a maximum of 255 characters.

region_id

String

Definition

Region ID.

Range

The value is a string. It contains 0 to 64 characters.

ep_id

String

Definition

Enterprise project ID.

Range

Select a project ID that is available inEnterprise Management.

ep_name

String

Definition

Enterprise project name.

Range

The value can contain a maximum of 255 characters, including letters, digits, underscores (_), and hyphens (-). It cannot contain any case-sensitive default.

tags

Array of TagResponse objects

Definition

Resource tag.

Range

N/A

agent_id

String

Definition

ID of the UniAgent.

Range

N/A

agent_state

String

Definition

UniAgent status.

Range

  • ONLINE: The UniAgent is running.

  • OFFLINE: The UniAgent is abnormal.

  • INSTALLING: The UniAgent is being installed.

  • FAILED: The UniAgent fails to be installed.

  • UNINSTALLED: The UniAgent is uninstalled.

  • null: The UniAgent is not installed.

properties

Object

Definition

Resource attributes.

Range

N/A

ingest_properties

Map<String,String>

Definition

Collection attribute.

Range

N/A

is_delegated

Boolean

Definition

Whether the resource is managed.

Range

  • true: The resource is managed.

  • false: The resource is not managed.

inner_ip

String

Definition

Internal IP address of the resource.

Range

N/A

operable

String

Definition

Whether a user-defined resource can be maintained.

Range

  • ENABLE: The instance can be maintained.

  • DISABLE: The resource is not maintainable. The operable field does not exist in the target instance.

is_associate_group

Boolean

Definition

Whether the resource is associated with a specified group.

Range

  • true: The resource is associated with a specified group.

  • false: The resource is not associated with a specified group.

associated_group_list

Array of strings

Definition

List of groups associated with resources.

Range

N/A

create_time

String

Definition

Creation time. The value is in the ISO 8601 format.

Range

N/A

update_time

String

Definition

Modification time. The value is in the ISO 8601 format.

Range

N/A

Table 5 TagResponse

Parameter

Type

Description

key

String

Definition

Tag key.

Range

A tag key can contain up to 128 characters. It cannot start with sys or a space, and cannot end with a space. Only letters, digits, spaces, and the following special characters are allowed: _ . : = + - @

value

String

Definition

Tag 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

Table 6 Response header parameters

Parameter

Type

Description

X-request-id

String

Definition

Request ID used for task tracing.

Range

request_uuid-timestamp-host_name.

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code.

Range

The value is a string. It contains 8 to 36 characters.

error_msg

String

Definition

Error description.

Range

The value is a string. It contains 2 to 512 characters.

Example Requests

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

All resources of the user are queried.

{
  "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

All resources of the user are queried.

400

All resources of the user fail to be queried.

Error Codes

See Error Codes.