Help Center/ ServiceStage/ API Reference/ CSE APIs/ Engine Management/ Creating an Exclusive Microservice Engine
Updated on 2024-12-16 GMT+08:00

Creating an Exclusive Microservice Engine

Function

This API is used to create an exclusive microservice engine.

URI

POST /v2/{project_id}/enginemgr/engines

Table 1 Path parameter

Parameter

Mandatory

Type

Description

project_id

Yes

String

Tenant sub-project ID, which must be unique. The value contains 1 to 64 characters. See Obtaining a Project ID.

Request

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

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

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of an exclusive microservice engine. The value contains 3 to 24 characters, including letters, and digits, and starts with a letter but cannot end with a hyphen (-).

NOTICE:

Microservice engine name cannot be default.

description

No

String

Description of an exclusive microservice engine. The value contains 0 to 255 characters.

payment

Yes

String

Billing mode of an exclusive microservice engine.

Set it to the fixed value 1.

flavor

Yes

String

Flavor of an exclusive microservice engine.

  • cse.s1.small2: HA 100-instance engine
  • cse.s1.medium2: HA 200-instance engine
  • cse.s1.large2: HA 500-instance engine
  • cse.s1.xlarge2: HA 2,000-instance engine

azList

Yes

Array of String

List of AZs at the current region.

authType

Yes

String

Authentication mode of an exclusive microservice engine. RBAC indicates security authentication, and NONE indicates no authentication.

authConfig

No

Table 4

RBAC configuration of a microservice engine. If this parameter is not transferred, programming interface authentication is enabled by default.

vpc

Yes

String

VPC name.

vpcId

Yes

String

VPC ID. The value can contain up to 64 characters.

networkId

Yes

String

Subnet ID of an exclusive microservice engine.

subnetCidr

Yes

String

Subnet division of an exclusive microservice engine.

publicIpId

No

String

ID of the public network address for accessing an exclusive microservice engine.

specType

Yes

String

Deployment type of an exclusive microservice engine.

  • For the 1.x engine, the value is fixed to CSE.
  • For the 2.x engine, the value is fixed to CSE2.

auth_cred

No

object

This parameter is mandatory when security authentication needs to be enabled for an exclusive microservice engine. It contains the authentication information of the engine.

inputs

No

Map<String,String>

Additional parameter of an exclusive microservice engine.

Table 4 authConfig

Parameter

Mandatory

Type

Description

consoleAuthEnabled

Yes

Boolean

Whether to enable console authentication.

sdkAuthEnabled

Yes

Boolean

Whether to enable programming interface authentication.

If the programming interface authentication parameter sdkAuthEnabled is set to true, the console security authentication parameter consoleAuthEnabled must also be set to true.

Table 5 object

Parameter

Mandatory

Type

Description

pwd

Yes

String

root password for enabling security authentication.

Response

Status code: 200

Table 6 Response body parameters

Parameter

Type

Description

id

String

ID of an exclusive microservice engine.

name

String

Name of an exclusive microservice engine.

jobId

Integer

ID of an exclusive microservice engine job.

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Status code: 500

Table 8 Response body parameters

Parameter

Type

Description

errorCode

String

Error code.

errorMessage

String

Error message.

detail

String

Location details.

Example Request

Create exclusive microservice engine test: billing mode is pay-per-use, flavor is cse.s1.small2, AZ is test, security authentication is disabled, and deployment type is CSE2.

POST https://{endpoint}/v2/{project_id}/enginemgr/engines
{
	"name": "test",
	"description": "test",
	"payment": "1",
	"flavor": "cse.s1.small2",
	"azList": ["test"],
	"authType": "NONE",
	"vpc": "vpc-demotest",
	"vpcId": "09902850-9454-4715-9764-018f0c37022",
	"networkId": "88550801-e892-4f8e-b21b-f7147f6229",
	"subnetCidr": "192.168.0.5/26",
	"specType": "CSE2,
	"inputs": {
		"nodeFlavor": "s6.large.2"
	}
}

Example Response

{   
  "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 CSE Error Codes.