Updated on 2025-12-05 GMT+08:00

Creating a Component

Function

This API is used to create a component after you create an application or sub-application.

URI

POST /v1/components

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Definition

Component name.

Constraints

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

Range

It contains 3 to 50 characters.

Default value

N/A

application_id

Yes

String

Definition

Application ID.

Constraints

N/A

Range

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

Default value

N/A

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

data

String

UUID allocated by CloudCMDB

Example Requests

Create a component.

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

{
  "name" : "Test component",
  "application_id" : "67e3b885ef614c77c8b76f4c"
}

Example Responses

Status code: 200

The component is created.

{
  "data" : {
    "id" : "685d1e8e02a50263fb2c259c",
    "name" : "Test component",
    "code" : null,
    "domainId" : "dc2d76541f754d68a4c8d150262d92c2",
    "applicationId" : "67e3b885ef614c77c8b76f4c",
    "path" : "string",
    "createTime" : "string",
    "updateTime" : "string"
  }
}

Status Codes

Status Code

Description

200

The component is created.

Error Codes

See Error Codes.