Updated on 2023-05-16 GMT+08:00

Creating a CBH Instance

Function

This API is used to create a CBH instance. Before creating a CBH instance subscription order, call this API to create a CBH instance.

URI

POST /v1/{project_id}/cbs/instance/create

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. You can obtain the project ID by referring to https://support.huaweicloud.com/intl/en-us/api-cbh/cbh_02_0020.html.

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

server

Yes

CBHInstances object

Parameters in the request for creating a CBH instance.

Table 3 CBHInstances

Parameter

Mandatory

Type

Description

flavor_ref

Yes

String

CBH instance specification ID. The format is "cbh.Edition.Asset specifications", for example:

  • cbh.basic.50

  • cbh.enhance.50 For more specifications, see "CBH Instance Editions" at https://support.huaweicloud.com/intl/en-us/productdesc-cbh/cbh_01_0010.html.

instance_name

Yes

String

CBH instance name. Value range: It can contain 1 to 64 characters, including only letters, digits, underscores (_), and hyphens (-). Example: CBH-6b8e

is_custom

No

String

Whether to manually assign an IP address. The value can only be True or False. The default value is False.

False: The IP address is automatically assigned.

master_ip

No

String

IP address of the active node. This parameter is mandatory when is_custom is set to True.

  • Only available IP addresses in the selected subnet can be used. If incorrect IP addresses are used, CBH cannot be created. Example: 192.168.0.1

salve_ip

No

String

IP address of the standby node. This parameter is mandatory when is_custom is set to True.

  • Only available IP addresses in the selected subnet can be used. If incorrect IP addresses are used, CBH cannot be created. Example, 192.168.0.2.

floating_ip

No

String

Floating IP address. This parameter is mandatory when is_custom is set to True.

  • Only available IP addresses in the selected subnet can be used. If incorrect IP addresses are used, CBH cannot be created. Example, 192.168.0.3.

vpc_id

Yes

String

ID of the VPC to which the ECS belongs. The value is in UUID format. You can obtain the VPC ID from the console or by referring to section Querying a VPC in the Virtual Private Cloud API Reference. Example: 03211ecf-697e-4306-a7a0-6e939bf948de

nics

Yes

Array of Nics objects

CBH instance NIC details

public_ip

Yes

PublicIp object

EIP bound to a CBH instance.

security_groups

Yes

Array of SecurityGroup objects

Security group information.

availability_zone

Yes

String

AZ where the CBH instance is created. You can view Regions and Endpoints at https://developer.huaweicloud.com/intl/en-us/endpoint.

slave_availability_zone

No

String

AZ where the standby CBH instance is created. You can view Regions and Endpoints at https://developer.huaweicloud.com/intl/en-us/endpoint.

comment

No

String

CBH instance description details

region

Yes

String

ID of the region where the cloud service is located.

hx_password

Yes

String

Password for logging in to the CBH instance. The password can contain 8 to 32 characters. It cannot contain amdin, nidma, or uppercase letters. It must contain three types of the following characters: uppercase, lowercase, digits, and special characters.

ipv6_enable

No

Boolean

Whether IPv6 addresses are supported. If this parameter is not specified, the default value is false.

Table 4 Nics

Parameter

Mandatory

Type

Description

subnet_id

Yes

String

Subnet ID, which consists of letters, digits, and underscores (_).

ip_address

No

String

IP address. If the value of this parameter is left blank or is set to an empty string, the IP address is automatically assigned.

Table 5 PublicIp

Parameter

Mandatory

Type

Description

id

Yes

String

You can provide the ID of the assigned EIP or the EIP.

public_eip

Yes

String

IP address mapped to the ID of the assigned EIP.

eip

No

Eip object

EIP

Table 6 Eip

Parameter

Mandatory

Type

Description

ip_type

Yes

String

IP address version of the EIP.

ip_product_id

Yes

String

Product ID corresponding to the IP address

bandwidth

Yes

BandWidth object

Bandwidth parameters.

Table 7 BandWidth

Parameter

Mandatory

Type

Description

size

Yes

String

Bandwidth. The value ranges from 1 to 100 for pay-per-use and from 1 to 300 for yearly/monthly subscriptions.

share_type

Yes

String

How the bandwidth is shared. Currently, only PER is supported.

charge_mode

Yes

String

The bandwidth billing type. The value can be traffic or null.

product_id

Yes

String

Product ID corresponding to the bandwidth.

Table 8 SecurityGroup

Parameter

Mandatory

Type

Description

id

Yes

String

Security group ID, which consists of letters, digits, and underscores (_).

Response Parameters

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Incorrect request parameter.

Status code: 401

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Failed to verify the token.

Status code: 403

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

Permissions required.

Status code: 404

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error Code

error_description

String

CBH instances not found.

Example Requests

{
  "server" : {
    "flavor_ref" : "cbh.basic.50",
    "instance_name" : "CBH-155f",
    "is_custom" : "false",
    "master_ip" : "192.168.0.1",
    "slave_ip" : "192.168.0.2",
    "floating_ip" : "192.168.0.3",
    "vpc_id" : "279e8217-4a8a-4d83-8fd9-b8f14d47170b",
    "nics" : [ {
      "subnet_id" : "a86217e6-a96d-4803-ae5c-b57da6811249"
    } ],
    "public_ip" : {
      "id" : "cfcab481-0831-4e23-a739-d6cdd0ef3630",
      "public_eip" : "123.249.41.4"
    },
    "security_groups" : [ {
      "id" : "1e10bc4f-9a36-4452-a867-8ddb4348c15e"
    } ],
    "availability_zone" : "cn-north-4a",
    "slave_availability_zone" : "cn-north-4b",
    "comment" : "success",
    "region" : "cn-north-4",
    "hx_password" : "12345678"
  }
}

Example Responses

None

Status Codes

Status Code

Description

200

Cbh CreateInstance Success

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

Error Codes

See Error Codes.