Updated on 2026-09-21 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 500.

  • The returned information includes the resource ID, resource name, cloud service name, resource type, project ID, tenant ID, region ID, enterprise project ID, resource tag, detailed resource attributes, ingested resource attributes, UniAgent ID, UniAgent status, hosting status, and O&M status.

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/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 appends a suffix similar to -0000 to each cloud resource name to distinguish them. If the name already ends with a suffix like "-0000", the system appends an additional, incrementing suffix after it. Therefore, the name length ranges from 1 to 59 characters.

Range

For details, see RMS-Managed Resource Information.

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

  • instances: cloud database instances

For details, see RMS-Managed Resource Information.

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

ip_list

No

Array of strings

Definition

IP address list.

Constraints

N/A

Range

List. The maximum value is 100.

Default value

N/A

name

No

String

Definition

Cloud resource name.

Constraints

N/A

Range

The value is a string. For details, see Bare Metal Server (BMS).

Default value

N/A

region_id

No

String

Definition

Region ID.

Constraints

N/A

Range

ID of the region with which the region is associated.

Default value

N/A

az_id

No

String

Definition

AZ ID.

Constraints

N/A

Range

N/A

Default value

N/A

ip_type

No

String

Definition

IP address type.

Constraints

N/A

Range

  • fixed: internal IP address

  • floating: EIP

Default value

N/A

ip

No

String

Definition

Cloud resource IP address.

Constraints

N/A

Range

Filtering results for IPv4 addresses, which are fuzzy matched.

Default value

N/A

status

No

String

Description:

Cloud resource status.

Constraints:

N/A

Value range :

Select an ECS status by referring to ECS.

Default value:

N/A

agent_state

No

String

Definition

Agent status.

Constraints

N/A

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.

Default value

N/A

image_name

No

String

Definition

Image name, which is used for fuzzy match.

Constraints

N/A

Range

N/A

Default value

N/A

os_type

No

String

Definition

System type.

Constraints

N/A

Range

  • windows: Windows OS.

  • linux: Linux OS.

Default value

N/A

tag

No

String

Definition

Cloud resource tag.

Constraints

A tag is in the format of "key.value". The maximum lengths of the key and value are 36 and 43 characters, respectively.

Range

The key of the tag can contain only letters, digits, underscores (), and hyphens (-). The value of the tag can contain only letters, digits, underscores (), hyphens (-), and periods (.).

Default value

N/A

tag_key

No

String

Definition

Tag key of a cloud resource.

Constraints

N/A

Range

N/A

Default value

N/A

group_id

No

String

Definition

Group ID of a cloud resource.

Constraints

If the group ID is used, the number of resources in the group is queried.

Range

N/A

Default value

N/A

component_id

No

String

Definition

Component ID of a cloud resource.

Constraints

If the component ID is used, the number of resources in the component is queried.

Range

N/A

Default value

N/A

application_id

No

String

Definition

Application ID of a cloud resource.

Constraints

If the application ID is used, the number of resources of the application is queried.

Range

N/A

Default value

N/A

cce_cluster_id

No

String

Definition

CCE cluster ID.

Constraints

N/A

Range

ID of the CCE cluster to which the resource belongs.

Default value

N/A

vpc_id

No

String

Definition

VPC to which the cloud resource to be created belongs. You need to specify the ID of the created VPC in UUID format.

Constraints

N/A

Range

N/A

Default value

N/A

ep_id

No

String

Definition

Enterprise project ID.

Constraints

N/A

Range

Select a project ID that is available in Enterprise Management.

Default Value

N/A

is_delegated

No

Boolean

Definition

Whether the resource is managed.

Constraints

N/A

Range

  • true: The resource is managed.

  • false: The resource is not managed.

Default value

N/A

project_id

No

String

Definition

Project ID.

Constraints

N/A

Range

N/A

Default value

N/A

is_collected

No

Boolean

Definition

Whether to add it to favorites.

Constraints

N/A

Range

  • true: The enterprise project has been added to favorites.

  • false: The enterprise project is not added to favorites.

Default value

N/A

flavor_name

No

String

Definition

Resource flavor name.

Constraints

N/A

Range

N/A

Default value

N/A

charging_mode

No

String

Definition

Cloud server billing mode.

Constraints

N/A

Range

Billing mode:

  • 0: pay-per-use

  • 1: yearly/monthly

  • 2: spot price

Default value

N/A

offset

No

String

Definition

Offset from which the query starts.

Constraints

N/A

Range

0 to 2147483647

Default value

0

show_associated_groups

No

String

Definition

Whether to display associated applications.

Constraints

N/A

Range

  • true: Associated application information is displayed.

  • false: Information about associated applications is not displayed.

Default value

N/A

operable

No

String

Definition

Whether a user-defined resource can be maintained.

Constraints

N/A

Range

  • ENABLE: The instance can be maintained.

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

Default value

N/A

create_since

No

String

Definition

Start date of the creation time. The value is in the ISO 8601 format.

Constraints

At least one of the start date and end date must exist.

Range

N/A

Default value

N/A

create_until

No

String

Definition

End date of the creation time. The value is in the ISO8601 format.

Constraints

At least one of the start date and end date must exist.

Range

N/A

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 in Enterprise 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/resources?limit=10&offset=0&type=cloudservers&provider=ecs&is_collected=true

Example Responses

Status code: 200

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

The resources of the user are queried.

400

The resources of the user fail to be queried.

Error Codes

See Error Codes.