Help Center/ Cloud Operations Center/ API Reference/ API/ Application Resource Management/ Associated Resources/ Querying the Total Number of Resources Associated with a Group
Updated on 2025-10-24 GMT+08:00

Querying the Total Number of Resources Associated with a Group

Function

This API is used to query the total number of resources associated with a group when resources are managed in different groups. The application ID and group ID cannot coexist, and either of them must be specified.

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:application:countResourceRelations

    List

    application *

    -

    -

    -

URI

GET /v1/group-resource-relations/count

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

application_id

No

String

Definition:

Application ID.

Constraints:

The application ID and group ID cannot coexist. At least one of them must be specified.

Value range:

N/A

Default value:

N/A

group_id

No

String

Definition:

Group ID.

Constraints:

The group ID and application ID cannot coexist. At least one of them must be specified.

Value range:

N/A

Default value:

N/A

provider

Yes

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

Yes

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

vendor

Yes

String

Definition:

Vendor information.

Constraints:

N/A

Value range:

  • RMS: Huawei Cloud

  • ALI: Alibaba Cloud vendor

  • OTHER: other vendors

Default value:

N/A

resource_id_list

No

Array of strings

Definition:

Resource ID list.

Constraints:

N/A

Value range:

A collection of resource IDs selected by users.

Default value:

N/A

name

No

String

Definition:

Cloud resource name.

Constraints:

N/A

Value range:

It is user-defined. For details, see Bare Metal Server (BMS).

Default value:

N/A

region_id

No

String

Definition:

Region ID.

Constraints:

N/A

Value 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

Value range:

N/A

Default value:

N/A

ip_type

No

String

Definition:

The property is in the IP address format.

Constraints:

N/A

Value range:

fixed: internal IP address

floating: elastic public IP address

Default value:

N/A

ip

No

String

Definition:

Cloud resource IP address.

Constraints:

N/A

Value range:

Filtering results for IPv4 addresses, which are fuzzy matched.

Default value:

N/A

status

No

String

Definition:

Cloud resource status.

Constraints:

N/A

Value range:

Select an ECS status that is available inECS.

Default value:

N/A

agent_state

No

String

Definition:

Agent status.

Constraints:

N/A

Value 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

Value range:

N/A

Default value:

N/A

os_type

No

String

Definition:

System type.

Constraints:

N/A

Value range:

  • window: 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.

Value 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

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:

N/A

Example Requests

This API is used to query the total number of resources associated with a group.

GET https://{Endpoint}/v1/group-resource-relations/count?provider=cce&type=clusters&application_id=673c04d5f77f2c62d81a3b58&is_collected=true&vendor=RMS

Example Responses

Status code: 200

The total number of resources associated with the group is queried.

{
  "data" : 14
}

Status Codes

Status Code

Description

200

The total number of resources associated with the group is queried.

Error Codes

See Error Codes.