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

Creating a Group

Function

This API is used to create groups for applications, sub-applications, and components to manage resources in a unified manner.

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:createGroup

    Write

    application *

    -

    -

    -

URI

POST /v1/groups

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition:

Application name.

Constraints:

The value can contain only letters, digits, hyphens (-), and underscores (_).

Value range:

The value is a string. It can contain 3 to 50 characters.

Default value:

N/A

component_id

Yes

String

Definition:

Component ID.

Constraints:

N/A

Value range:

ID of the component corresponding to the group created after the component is selected.

Default value:

N/A

vendor

No

String

Definition:

Vendor information.

Constraints:

N/A

Value range:

  • RMS: Huawei Cloud

  • ALI: Alibaba Cloud vendor

  • OTHER: other vendors

Default value:

N/A

region_id

Yes

String

Definition:

Region ID.

Constraints:

N/A

Value range:

ID of the region with which the application is associated.

Default value:

N/A

application_id

No

String

Definition:

Application ID.

Constraints:

N/A

Value range:

ID of the application for the component corresponding to the group. There is a clear hierarchy between them.

Default value:

N/A

sync_mode

Yes

String

Definition:

Resource synchronization method.

Constraints:

N/A

Value range:

  • MANUAL: indicates manual association. You can manually associate resource data with a group for management.

  • AUTO: indicates intelligent association. You can create resources with the same tag in an enterprise project in the same resource group.

Default value:

The default value is MANUAL.

sync_rules

No

Array of sync_rules objects

Definition:

Automatic association rule.

Constraints:

N/A

Value range:

The selected enterprise project is intelligently associated with the existing and future resources of the corresponding tag.

Default value:

N/A

relation_configurations

No

Array of GroupRelationConfiguration objects

Definition:

Group configuration information.

Constraints:

N/A

Value range:

Associated configuration information of the group, for example, configuration information of the corresponding APM.

Default value:

N/A

Table 2 sync_rules

Parameter

Mandatory

Type

Description

ep_id

No

String

Definition:

Enterprise project ID.

Constraints:

N/A

Value range:

Select a project ID that is available inEnterprise Management.

Default value:

N/A

rule_tags

No

String

Definition:

Tag that is associated with resources.

In the enterprise project, only resources that match all the configured tags will be automatically allocated to the application group.

Constraints:

N/A

Value range:

This parameter can be customized.

Default value:

N/A

Table 3 GroupRelationConfiguration

Parameter

Mandatory

Type

Description

type

No

String

Definition:

Configuration type. Configure the application, component, and environment of the APM service corresponding to the group. APM service performance information can be obtained during fault diagnosis.

Constraints:

N/A

Value range:

  • APM: probe developed by the APM service

  • OTEL: open-source probe OpenTelemetry

  • SKYWALKING: open-source probe SkyWalking

Default value:

N/A

parameters

No

Map<String,String>

Definition:

Configuration parameters.

Constraints:

N/A

Value range:

APM configuration parameter app_id->business_id->env_id.

The value contains multiple fields. The maximum length is for reference only.

Default value:

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

data

data object

Definition:

Application management information.

Value range:

N/A

Table 5 data

Parameter

Type

Description

id

String

Definition:

UUID allocated by COC-CMDB.

Value range:

N/A

name

String

Definition:

Group name.

Value range:

The value can contain 3 to 50 characters, including letters, digits, hyphens (-), underscores (_), and Chinese characters.

vendor

String

Definition:

Vendor.

Value range:

  • RMS: Huawei Cloud

  • ALI: Alibaba Cloud vendor

  • OTHER: other vendors

code

String

Definition:

Group code.

Value range:

N/A

domain_id

String

Definition:

Tenant ID.

Value range:

N/A

region_id

String

Definition:

Region ID.

Value range:

N/A

component_id

String

Definition:

Component ID.

Value range:

N/A

application_id

String

Definition:

Application ID.

Value range:

N/A

path

String

Definition:

Group path.

Value range:

N/A

create_time

String

Definition:

Creation time. The value is in the ISO 8601 format.

Value range:

N/A

update_time

String

Definition:

Update time. The value is in the ISO 8601 format.

Value range:

N/A

sync_mode

String

Definition:

Update time.

Value range:

  • MANUAL: manual association

  • AUTO: intelligent association

sync_rules

Array of sync_rules objects

Definition:

Automatic association rule.

Value range:

N/A

related_domain_id

String

Definition:

ID of the domain to which the cross-account resource belongs.

Value range:

N/A

relation_configurations

Array of GroupRelationConfiguration objects

Definition:

Group configuration information.

Value range:

N/A

Table 6 sync_rules

Parameter

Type

Description

ep_id

String

Definition:

Enterprise project ID.

Value range:

Select a project ID that is available inEnterprise Management.

rule_tags

String

Definition:

Tag that is associated with resources.

Value range:

N/A

Table 7 GroupRelationConfiguration

Parameter

Type

Description

type

String

Definition:

Configuration type. Configure the application, component, and environment of the APM service corresponding to the group. APM service performance information can be obtained during fault diagnosis.

Constraints:

N/A

Value range:

  • APM: probe developed by the APM service

  • OTEL: open-source probe OpenTelemetry

  • SKYWALKING: open-source probe SkyWalking

Default value:

N/A

parameters

Map<String,String>

Definition:

Configuration parameters.

Constraints:

N/A

Value range:

APM configuration parameter app_id->business_id->env_id.

The value contains multiple fields. The maximum length is for reference only.

Default value:

N/A

Example Requests

This API is used to create a group.

POST https://{Endpoint}/v1/groups

{
  "name" : "test1212",
  "region_id" : "string",
  "related_domain_id" : null,
  "component_id" : "678236a93f1b240bc02b3e4f",
  "sync_mode" : "AUTO",
  "vendor" : "RMS",
  "sync_rules" : [ {
    "ep_id" : "0",
    "rule_tags" : "string"
  } ],
  "relation_configurations" : null
}

Example Responses

Status code: 200

Response body for creating a group.

{
  "data" : {
    "id" : "685cff9aa2cf591eae464a6a",
    "name" : "test1212",
    "code" : null,
    "domainId" : "dc2d76541f754d68a4c8d150262d92c2",
    "regionId" : "string",
    "applicationId" : "6780dec23f1b240bc0295d11",
    "componentId" : "678236a93f1b240bc02b3e4f",
    "path" : "6835d67559221e2d9a6bfa1b.6895bab5e86fed4474120a77",
    "vendor" : "RMS",
    "createTime" : "2023-06-14T09:44:22.116+00:00",
    "updateTime" : "2023-06-14T09:44:22.116+00:00",
    "syncMode" : "AUTO",
    "syncRules" : null,
    "relationConfigurations" : null,
    "relatedDomainId" : null
  }
}

Status Codes

Status Code

Description

200

Response body for creating a group.

Error Codes

See Error Codes.