Updated on 2025-10-24 GMT+08:00

Querying Resources Associated with a Group

Function

This API is used to query the resource information related to a group after a group is associated with 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:application:listResources

    List

    application *

    -

    -

    -

    -

    coc:ApplicationGroupCode

URI

GET /v1/group-resource-relations

Table 1 Query Parameters

Parameter

Mandatory

Type

Description

application_id

No

String

Definition:

ID of the application associated with the group.

Constraints:

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

Value range:

N/A

Default value:

N/A

component_id

No

String

Definition:

ID of the component associated with the group.

Constraints:

The application ID, group ID, and component 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 application ID, group ID, and component 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

vendor

Yes

String

Definition:

Vendor information.

Constraints:

N/A

Value range:

AWS: Amazon Web Services (AWS)

  • AZURE: Microsoft Azure

  • ALI: Alibaba Cloud

  • RMS: Huawei Cloud

  • CROSS_ACCOUNT: cross-account resources

  • OTHER: other vendors, for example, IDC offline resources

Default value:

N/A

type

Yes

String

Definition:

Resource type.

Constraints:

N/A

Value range:

Resource type. Select a resource type based on the actual service requirements. 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

limit

Yes

Integer

Definition:

Number of items displayed on each page when the pagination query is performed.

Constraints:

N/A

Value range:

It is user-defined. The value ranges from 1 to 500.

Default value:

N/A

offset

No

String

Definition:

Offset for pagination query, indicating that the query starts from this offset.

Constraints:

N/A

Value range:

0 to 2147483647

Default value:

0

marker

No

String

Definition:

Pagination query parameter, which is the last ID of the request on the previous page.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

resource_id_list

No

Array of strings

Definition:

Resource ID list.

Constraints:

N/A

Value range:

Resource ID list. The maximum value is 100.

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

Constraints:

N/A

Value range:

Region ID list. The maximum value is 100.

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

charging_mode

No

String

Definition:

Cloud server billing mode.

Constraints:

N/A

Value range:

Billing mode.

  • 0: pay-per-use

  • 1: yearly/monthly

  • 2: spot price

Default value:

N/A

flavor_name

No

String

Definition:

Flavor name.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

ip_list

No

Array of strings

Definition:

IP address list.

Constraints:

N/A

Value range:

List. The maximum value is 100.

Default value:

N/A

is_collected

No

Boolean

Definition:

Whether to add it to favorites.

Constraints:

N/A

Value range:

  • true: Query the resource associations managed in the group that is added to favorites.

  • false: Query the resource associations managed in the group that is not added to favorites.

Default value:

N/A

Request Parameters

None

Response Parameters

Status code: 200

The resources associated with the group are queried.

None

Example Requests

This API is used to query resources associated with a group.

GET https://{endpoint}/v1/group-resource-relations?provider=cce&type=clusters&limit=10&offset=0&application_id=660557b2dc48844adc49eaa5&is_collected=false&vendor=RMS

Example Responses

Status code: 200

The resources associated with the group are queried.

{
  "data" : [ {
    "id" : "687740684dbc6000ac47f0af",
    "cmdb_resource_id" : "687733804dbc6000ac3eaf51",
    "group_id" : "66055804dc48844adc49eaae",
    "group_name" : "RMSaUTODDD",
    "resource_id" : "38fbefc2-5c76-11f0-8a3e-0255ac100b06",
    "name" : "cdr-test",
    "provider" : "cce",
    "type" : "clusters",
    "region_id" : "string",
    "ep_id" : "0",
    "ep_name" : null,
    "project_id" : "23a154c6e0be4cd282538462825fca67",
    "domain_id" : "adabd970539e4ebb8141ca2cf3b571f1",
    "tags" : null,
    "agent_id" : null,
    "agent_state" : null,
    "inner_ip" : null,
    "properties" : {
      "clusterEOSVersion" : "false",
      "clusterType" : "VirtualMachine",
      "clusterSubnetId" : "22b498de-32fa-46e8-abf4-2be88693f114",
      "clusterEIP" : "",
      "clusterChargeMode" : "0",
      "clusterVpcId" : "b6e5c685-d16a-4534-a023-bd67049f5cdd",
      "clusterFlavor" : "cce.s2.small",
      "clusterSecGroup" : "99000d1a-2f08-419a-a1d7-c02eb6c3b945",
      "clusterOldestVersion" : "false",
      "clusterVersion" : "v1.30.10-r10",
      "clusterStatus" : "Available"
    },
    "ingest_properties" : null,
    "operable" : null,
    "create_time" : "2025-07-09T03:38:48.000+00:00"
  } ]
}

Status Codes

Status Code

Description

200

The resources associated with the group are queried.

Error Codes

See Error Codes.