Updated on 2025-04-25 GMT+08:00

Creating a Microservice Engine

Function

This API is used to create a microservice engine. You can create an exclusive ServiceComb engine or registry/configuration center.

URI

POST /v2/{project_id}/enginemgr/engines

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID, which must be unique. The value contains 1 to 64 characters.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

If this parameter is not set, the default enterprise project is default and the ID is 0.

Default value: 0

Content-Type

Yes

String

Set it to application/json;charset=UTF-8.

Accept

Yes

String

Set it to application/json.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Microservice engine name.

description

No

String

Microservice engine description.

Maximum length: 255

payment

Yes

String

Billing mode of a microservice engine. 0 indicates yearly/monthly, 1 indicates pay-per-use, and 2 indicates free of charge.

Enumerated values:

  • 0: yearly/monthly (not supported).
  • 1: pay-per-use.
  • 2: free of charge (not supported).

Maximum length: 24

flavor

Yes

String

Microservice engine flavor.

  • cse.s1.xxx: flavor of an exclusive ServiceComb engine.
  • cse.nacos2.xxx: flavor of a registry/configuration center.

Enumerated values:

  • cse.s1.small2
  • cse.s1.medium2
  • cse.s1.large2
  • cse.s1.xlarge2
  • cse.nacos2.c1.large.10
  • cse.nacos2.c1.xlarge.20
  • cse.nacos2.c1.xlarge.40
  • cse.nacos2.c1.xlarge.60
  • cse.nacos2.c1.2xlarge.100

azList

No

Array of strings

List of AZs where an exclusive ServiceComb engine is deployed. This parameter is mandatory when you create an exclusive ServiceComb engine.

Array length: 1–3

authType

No

String

Authentication type of the engine. This parameter is mandatory when you create an exclusive ServiceComb engine. RBAC indicates security authentication, and NONE indicates no authentication.

Enumerated values:

  • RBAC
  • NONE

vpc

Yes

String

VPC name.

Maximum length: 64

vpcId

Yes

String

VPC ID.

Maximum length: 64

networkId

Yes

String

Subnet ID of a microservice engine.

Maximum length: 64

subnetCidr

Yes

String

Subnet division of a microservice engine.

Maximum length: 24

publicIpId

No

String

Public network address ID of a microservice engine. Currently, the value is null.

Maximum length: 64

auth_cred

No

EngineRbacPwd object

This parameter is mandatory when RBAC authentication is selected for creating an exclusive ServiceComb engine. It contains the engine authentication information.

specType

Yes

String

Deployment type of a microservice engine.

Default value: CSE2

Enumerated values:

  • CSE2
  • Nacos2

inputs

No

Map<String,String>

Additional parameter of an engine.

enginestateInfo

No

enginestateInfo object

Engine status information.

periodType

No

Integer

Creation period type.

enterpriseProject

No

enterpriseProject object

Enterprise project information.

vpcCidr

No

String

Gateway VPC division.

resourceParams

No

resourceParams object

Microservice engine resource parameter.

productId

No

String

Product ID.

capacityProductId

No

String

Capacity product ID.

isFree

No

Boolean

Whether the microservice engine is free of charge.

subnetName

No

String

Name of the subnet used by a microservice engine.

tags

No

Array of strings

Tag.

elbid

No

String

ID of the ELB used by a microservice engine.

Table 4 EngineRbacPwd

Parameter

Mandatory

Type

Description

pwd

No

String

Password of the default user root of an exclusive microservice engine with security authentication enabled.

Table 5 enginestateInfo

Parameter

Mandatory

Type

Description

cluster

No

Boolean

Cluster.

twinClusters

No

Boolean

Twin cluster.

singleEngine

No

Boolean

Single engine.

Table 6 enterpriseProject

Parameter

Mandatory

Type

Description

id

No

String

Enterprise project ID.

name

No

String

Enterprise project name.

description

No

String

Enterprise project description.

status

No

Integer

Enterprise project status.

created_at

No

String

Creation time of an enterprise project.

updated_at

No

String

Update time of an enterprise project.

label

No

String

Enterprise project label.

Table 7 resourceParams

Parameter

Mandatory

Type

Description

isAutoRenew

No

Integer

Automatic refresh or not.

Response

Status code: 200
Table 8 Response body parameters

Parameter

Type

Description

id

String

Microservice engine ID.

name

String

Microservice engine name.

jobId

Integer

ID of the job executed by a microservice engine.

Status code: 400
Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Status code: 500
Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Request

POST https://{endpoint}/v2/{project_id}/enginemgr/engines

{
  "name" : "string",
  "description" : "string",
  "payment" : "string",
  "flavor" : "cse.s1.small2",
  "azList" : [ "string" ],
  "authType" : "NONE",
  "vpc" : "string",
  "networkId" : "string",
  "subnetCidr" : "string",
  "publicIpId" : "string",
  "specType" : "string",
  "inputs" : {
    "nodeFlavor" : "string"
  }
}

Example Response

Status code: 200

Response structure for creating a microservice engine.

{
  "id" : "891bf21a-4024-4f47-b38c-bd259ca8f10a",
  "name" : "test",
  "jobId" : 17655
}

Status Code

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Code

See Error Codes.