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-12-05 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.

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.

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.

Range

N/A

Default value

N/A

provider

Yes

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

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

vendor

Yes

String

Definition

Vendor information.

Constraints

N/A

Range

  • RMS: Huawei Cloud vendor.

  • 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

Range

A collection of resource IDs selected by users.

Default value

N/A

name

No

String

Definition

Cloud resource name.

Constraints

N/A

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

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 toECS.

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

Request Parameters

None

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

data

Long

Definition

Number of cloud resources.

Range

N/A

Example Requests

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.