Help Center/ Cloud Service Engine/ API Reference/ CSE API/ Engine Management/ Creating an Exclusive Microservice Engine
Updated on 2023-12-18 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 Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Unique ID of a tenant's sub-project. The value contains 1 to 64 characters.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

X-Enterprise-Project-ID

No

String

Default enterprise project: default. Default ID: 0.

Default: 0

Content-Type

Yes

String

Enter application/json;charset=UTF-8.

Accept

Yes

String

Enter application/json.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Name of an exclusive microservice engine.

description

No

String

Description of an exclusive microservice engine.

Maximum: 255

payment

Yes

String

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

Maximum: 24

flavor

Yes

String

Flavor of an exclusive microservice engine.

Enumeration values:

  • cse.s1.small2
  • cse.s1.medium2
  • cse.s1.large2
  • cse.s1.xlarge2

azList

Yes

Array of strings

List of AZs at the current region.

authType

Yes

String

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

Enumeration values:

  • RBAC
  • NONE

vpc

Yes

String

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

vpcId

No

String

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

networkId

Yes

String

Subnet ID of a microservice engine. The value can contain up to 64 characters.

subnetCidr

Yes

String

Subnet division of a microservice engine.The value can contain up to 24 characters.

publicIpId

No

String

ID of the public network address for accessing a microservice engine. The value can contain up to 64 characters.

auth_cred

No

EngineRbacPwd object

This parameter is mandatory when RBAC authentication is selected. It contains the authentication information of the engine.

specType

Yes

String

Deployment type of a microservice engine.

Default: CSE

Enumeration values:

  • CCE
  • CSE
  • SpringCloud

inputs

No

Map<String,String>

Additional parameter of an exclusive 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.

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

id

String

ID of the exclusive microservice engine to be created.

name

String

Name of the exclusive microservice engine to be created.

jobId

Integer

ID of a microservice engine job.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

detail

String

Location details.

Example Requests

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 Responses

Status code: 200

OK

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

Status Codes

Status Code

Description

200

OK

400

Bad Request

500

Internal Server Error

Error Codes

See CSE Error Codes.