Help Center/ Cloud Operations Center/ API Reference/ API/ Application Resource Management/ Resource Views/ Querying the Total Number of Resources Aggregated in the CloudCMDB Cross-Account Resource View
Updated on 2025-10-24 GMT+08:00

Querying the Total Number of Resources Aggregated in the CloudCMDB Cross-Account Resource View

Function

After a view is created, you can query and filter the number of aggregated resources in the CloudCMDB cross-account resource view to obtain the total number of resources.

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:resourceView:countResources

    Read

    -

    -

    -

    -

URI

GET /v1/resource/views/resources/count

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

view_id

Yes

String

Definition:

View ID

Constraints:

N/A

Value range:

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

Default value:

N/A

provider

No

String

Definition:

Cloud service name.

Constraints:

N/A

Value range:

The value is a string. The value can be ecs, cce, or rds.

Default value:

N/A

type

No

String

Definition:

Resource type.

Constraints:

N/A

Value 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 server (BMSs)

  • clusters: Cloud Container Engine (CCE) instances

  • instances: cloud database instances

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

data

Long

Definition:

Number of cloud resources.

Value range:

The value ranges from 0 to 65,535.

Example Requests

Query the total number of resources aggregated in the cross-account resource view of CloudCMDB.

GET https://{Endpoint}/v1/resource/views/resources/count

Example Responses

Status code: 200

Response to the request for querying view resources.

{
  "data" : 3
}

Status Codes

Status Code

Description

200

Response to the request for querying view resources.

Error Codes

See Error Codes.