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

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

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.

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

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

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

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

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

data

Long

Definition

Number of cloud resources.

Range

The value range is 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

The view resource is queried.

{
  "data" : 3
}

Status Codes

Status Code

Description

200

The view resource is queried.

Error Codes

See Error Codes.