Updated on 2025-08-15 GMT+08:00

Purchasing a FlexusL Instance

Function

This API is used to subscribe to one or more FlexusL instances.

This API is an asynchronous API. After a subscription API request is delivered, order_id and instances_ids are returned. This means the order is created, but the creation of FlexusL instances has not been completed.

Use the order_id returned by this API to call the API of Querying Order Details. Check the creation status of the FlexusL instances based on the value of status in the response message. If the value of status is 5, the FlexusL instances are created.

API Gateway Address

https://hcss.ap-southeast-3.myhuaweicloud.com

URL

POST /v1/light-instances

Request

Table 1 Header parameters

Parameter

Mandatory (Yes/No)

Type

Description

Client-Request-Id

Yes

String

Definition

Unique request ID specified by a user to locate a request. UUID is recommended.

Constraints

N/A

Range

The value can contain 36 to 128 characters, including letters, digits, and hyphens (-). The value is case-sensitive and must start with a digit or a letter.

Default Value

N/A

X-Auth-Token

Yes

String

Definition

User token.

This API uses token-based authentication. The value of X-Auth-Token is that of X-Subject-Token in the header of the response returned by the API for obtaining a token. For details about authentication operations, see Authentication.

NOTE:

The token changes by region. Obtain the token based on the region where the resource is located. After switching the region, you need to obtain the token again.

Constraints

N/A

Range

Signed token, which is less than 32 KB.

Default Value

N/A

Table 2 Body parameters

Parameter

Mandatory (Yes/No)

Type

Description

instance_name

Yes

String

Definition

Instance name.

Constraints

N/A

Range

The value can contain letters, digits, underscores (_), and hyphens (-). It is case-sensitive and must start with a letter. It can contain 1 to 128 characters.

Default Value

N/A

description

No

String

Definition

Instance description.

Constraints

N/A

Range

The value can contain 0 to 1,024 characters. There are no restrictions on the character type.

Default Value

N/A

plan_spec

Yes

String

Definition

Specification code.

Constraints

N/A

Range

Different images support different specification codes. For details, see Appendix.

Default Value

N/A

image_ref

No

ImageRef

Definition

Image information.

Constraints

N/A

Range

For details, see Table 3.

Default Value

N/A

region

Yes

String

Definition

Region.

Constraints

N/A

Range

Currently, the following regions are supported: ap-southeast-1 (CN-Hong Kong), ap-southeast-3 (AP-Singapore), ap-southeast-2 (AP-Bangkok), tr-west-1 (TR-Istanbul), sa-brazil-1 (LA-Sao Paulo1), and me-east-1 (ME-Riyadh).

Default Value

N/A

charging_mode

No

String

Definition

Billing mode.

Constraints

N/A

Range

prePaid: yearly/monthly billing mode.

Default Value

prePaid

period_type

Yes

String

Definition

Subscription period.

Constraints

N/A

Range

  • month: indicates that the subscription period is month.
  • year: indicates that the subscription period is year.

Default Value

N/A

period_num

Yes

String

Explanation: The number of subscription periods.

Constraints

N/A

Range

  • If periodType is month, the value ranges from 1 to 9.
  • If periodType is year, the value ranges from 1 to 3.

Default Value

N/A

purchase_quantity

No

int

Definition

Purchase quantity.

Constraints

N/A

Range

1–200

Default Value

1

is_auto_renew

No

boolean

Definition

Whether auto-renew is enabled.

Constraints

N/A

Range

  • true: indicates that auto-renew is enabled.
  • false: indicates that auto-renew is disabled.

Default Value

false

is_auto_pay

No

boolean

Definition

Whether the payment will be automatically deducted from your account balance when an order is submitted.

Constraints

N/A

Range

  • true: The order will be automatically paid.
  • false: You must manually pay the order.

Default Value

false

ExtraResources

No

Array of ExtraResources

Definition

Additional resource information.

Constraints

N/A

Range

For details, see Table 4.

Default Value

N/A

tags

No

Array of Tags

Definition

Custom tags.

Constraints

N/A

Range

For details, see Table 5.

Default Value

N/A

Table 3 ImageRef parameters

Parameter

Mandatory (Yes/No)

Type

Description

image_name

No

String

Definition

Names of the application images or OS images supported by FlexusL.

Constraints

This parameter is required when a FlexusL instance is created using application images or OS images. This parameter is not required when a FlexusL instance is created using a private image.

Range

For details about the supported image names, see Application Images or OS Images.

Default Value

N/A

image_version

No

String

Definition

Versions of the application images or OS images supported by a FlexusL instance.

Constraints

This parameter is required when a FlexusL instance is created using application images or OS images. This parameter is not required when a FlexusL instance is created using a private image.

Range

For details about the supported image versions, see Application Images or OS Images.

Default Value

N/A

image_id

No

String

Definition

Private image ID.

Constraints

The image ID of the private image is provided by a user only when a private image is used to create a FlexusL instance. This parameter is not required if an OS image or application image is used to create a FlexusL instance.

Range

ID of a private image.

Default Value

N/A

Table 4 ExtraResources parameters

Parameter

Mandatory (Yes/No)

Type

Description

type

Yes

String

Definition

Additional resource type.

Constraints

N/A

Range

  • evs indicates data disks.
  • cbr indicates cloud backups.
  • hss indicates host security.

Default Value

N/A

size

No

Int

Definition

Capacity of the resources whose type is evs or cbr.

Constraints

This parameter is not involved for the hss resource type.

Range

The unit is GiB. The value ranges from 10 to 2048.

Default Value

N/A

Table 5 Tags parameters

Parameter

Mandatory (Yes/No)

Type

Description

key

Yes

String

Definition

Key of a user-defined tag.

Constraints

N/A

Range

The value can contain 1 to 32 characters, including letters, digits, underscores (_), and hyphens (-). It is case-sensitive and must start with a letter.

Default Value

N/A

value

Yes

String

Definition

Value of a user-defined tag.

Constraints

N/A

Range

The value can contain 0 to 2,048 characters. There are no restrictions on the character type.

Default Value

N/A

Response

Table 6 Tags parameters

Parameter

Type

Description

order_id

String

Definition

Order number.

Range

N/A

instance_ids

Array of strings

Definition

Instance IDs.

Range

N/A

Use the order_id returned by this API to call the API of Querying Order Details. Check the creation status of the FlexusL instances based on the value of status in the response message. If the value of status is 5, the FlexusL instances are created.

Example Request

Create an order of two instances named test-0620-01. The instances use the specification code hf.large.1.30m.linux and image version BT 6.8.35 and are created in the AP-Singapore region. The required duration is 1 month, and auto payment and auto-renewal wal are enabled. The order also includes 20 GB data disks, 20 GB cloud backups, and HSS.

https://hcss.ap-southeast-3.myhuaweicloud.com/v1/light-instances
Client-Request-Id: 85a56f6c-8aee-xxxx-bf76-5d98d1ac023d
X-Auth-Token: MIIatAYJKoZIhvcNAQc...TCCGqECAQExDTALB   // The token changes by region. Obtain the token based on the region where the resource is located. After switching the region, you need to obtain the token again.

{
  "instance_name": "test-0620-01",
  "description": "test",
  "plan_spec": "hf.large.1.30m.linux",
  "image_ref": {
    "image_name": "BT",
    "image_version": "6.8.35"
  },
  "region": "ap-southeast-3",
  "charging_mode": "prePaid",
  "period_type": "month",
  "period_num": 1,
  "purchase_quantity": 2,
  "is_auto_renew": true,
  "is_auto_pay": true,
  "extra_resources": [
    {
      "type": "evs",
      "size": 20
    },
    {
      "type": "cbr",
      "size": 20
    },
    {
      "type": "hss"
    }
  ]
}

Example Response

{
    "order_id": "CS24022811305H1EW",
    "instance_ids": [
        "65dea8d23005da564c78d9d2"
    ]
 }

Returned Values

Table 7 Returned values

Status Code

Description

202

The request is accepted and processed asynchronously.

400

Invalid request.

401

Authentication failed.

403

The user does not have the permission to call this API.

429

There are too many requests.

500

Internal server error.

Error Codes

Table 8 Error codes

HTTP Status Code

Error Code

Description

400

HCSS.14000001

Invalid parameter.

400

HCSS.14000002

CORS service request exception.

400

HCSS.14000003

CBC service request exception.

400

HCSS.14000004

ECS service request exception.

400

HCSS.14000005

EVS service request exception.

400

HCSS.14000006

EIP service request exception.

400

HCSS.14000007

ELB service request exception.

400

HCSS.14000008

IMS service request exception.

400

HCSS.14000009

Marketplace image request exception.

400

HCSS.14000010

Insufficient specifications.

400

HCSS.14000011

Insufficient quota.

429

HCSS.14290001

Too many requests. Try again later.

500

HCSS.15000001

Server exception.

Appendix

The following describes the specification codes of images supported by this API.

The following table lists the specifications corresponding to the application images and their specification codes supported by the API.
Table 9 Application image specification codes

Image Name

Version

Supported Specification Code

BT

6.8.35

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

CRM

8.0

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Ghost

5.67

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

GitLab

16.9.3

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Joomla

5.0.3

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

KodBox

1.49

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Matomo

5.0.3

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Moodle

4.3.4

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Nextcloud

28.0.3

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Nodejs

21

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Odoo

17.0

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Portainer

2.19.4

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

PrestaShop

8.1.5

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Redmine

5.1

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

SRS

6.0.101

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Superset

3.1.1

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

WordPress

6.4

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

The following table lists the specification versions corresponding to the system images and their specification codes supported by the API.

Table 10 OS image specification codes

Image Name

Version

Supported Specification Code

Ubuntu

22.04/20.04/18.04/16.04

hf.large.05.30m.linux

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Huawei Cloud EulerOS

2.0

hf.large.025.30m.linux (supported only in the CN-Hong Kong and AP-Singapore regions)

hf.large.05.30m.linux

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

CentOS

8.2/8.1/8.0/7.9/7.8/7.7/7.6/7.5/ 7.4/7.3/7.2

NOTE:

The TR-Istanbul and ME-Riyadh regions do not support 8.2, 8.1, 8.0, 7.3, or 7.2.

hf.large.025.30m.linux (supported only by images of version 7.6 in the CN-Hong Kong and AP-Singapore regions)

hf.large.05.30m.linux

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Debian

11.1/9.0

hf.large.025.30m.linux (supported only by images of version 11.1 in the CN-Hong Kong and AP-Singapore regions)

hf.large.05.30m.linux

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

The following table lists the specifications corresponding to the private images and their specification codes supported by the API.

Table 11 Private image specification codes

OS

Specification Code

Linux

hf.large.025.30m.linux

hf.large.05.30m.linux

hf.large.1.30m.linux

hf.large.2.30m.linux

hf.large.4.30m.linux

hf.xlarge.2.30m.linux

hf.xlarge.4.30m.linux

Windows

hf.large.1.30m.byol

hf.large.2.30m.byol

hf.large.4.30m.byol

hf.xlarge.2.30m.byol

hf.xlarge.4.30m.byol

The following table lists the specifications corresponding to the specification codes.

Table 12 Specifications corresponding to the Linux system specification codes

Specification Code

vCPUs

Memory (GiB)

System Disk (GiB)

Peak Bandwidth (Mbit/s)

Data Package (GB)

hf.large.025.30m.linux

2

0.5

20

30

1024

hf.large.05.30m.linux

2

1

40

30

2048

hf.large.1.30m.linux

2

2

60

30

3072

hf.large.2.30m.linux

2

4

80

30

4096

hf.large.4.30m.linux

2

8

160

30

5120

hf.xlarge.2.30m.linux

4

8

240

30

6144

hf.xlarge.4.30m.linux

4

16

320

30

7168

Table 13 Specifications of the Windows system specification codes

Specification Code

vCPUs

Memory (GiB)

System Disk (GiB)

Peak Bandwidth (Mbit/s)

Data Package (GB)

hf.large.1.30m.byol

2

2

60

30

3072

hf.large.2.30m.byol

2

4

80

30

4096

hf.large.4.30m.byol

2

8

160

30

5120

hf.xlarge.2.30m.byol

4

8

240

30

6144

hf.xlarge.4.30m.byol

4

16

320

30

7168