Create an IoTDA Instance
Function
This API is used to create an IoTDA instance. For details about the supported instance specifications, see Specifications.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
POST /v5/iot/{project_id}/iotda-instances
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Parameter description: project ID. For details, see Obtaining a Project ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
No |
String |
Parameter description: user token. You can obtain the token by calling the IAM API Obtaining a User Token Through Password Authentication. In the returned response header, X-Subject-Token is the desired user token. For details about how to obtain the token, see Token Authentication. Minimum: 0 Maximum: 1024000 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
instance_type |
Yes |
String |
Parameter description: type of the instance to be created. For details about instance types, see Specifications. Options:
|
flavor |
Yes |
Flavor object |
Parameter description: specifications of an IoTDA instance. |
name |
Yes |
String |
Parameter description: instance name. Value: Enter 1 to 64 characters, including letters, digits, underscores (_), and hyphens (-). |
charge_info |
Yes |
ChargeInfo object |
Parameter description: billing information of an IoTDA instance. |
description |
No |
String |
Parameter description: description of an IoTDA instance. Value: The value can contain a maximum of 256 characters. Use only letters, digits, and special characters (_,.&-). |
enterprise_project_id |
No |
String |
Parameter description: enterprise project ID. If this parameter is set to a specific enterprise project ID or 0 (default enterprise project ID), the enterprise project feature is supported. You can obtain the value from Enterprise Project Management Service (EPS). Value: Enter up to 36 characters, including lowercase letters (a-f), digits, and hyphens (-). Default: 0 |
tags |
No |
Array of Tag objects |
Parameter description: tag information of an IoTDA instance. Array Length: 0 - 20 |
additional_params |
No |
AdditionalParams object |
Additional parameter information of the enterprise edition. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
type |
Yes |
String |
Parameter description: specification name of the IoTDA instance to create. For details, see Specifications. |
size |
No |
Integer |
Parameter description: unit number of the standard IoTDA instances to create. For details, see Specifications. This parameter is mandatory when instance_type is set to standard. Minimum: 1 Maximum: 200 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
charge_mode |
Yes |
String |
Parameter description: payment mode of the instance. Options:
|
period_type |
No |
String |
Parameter description: period type of the subscribed IoTDA instance. This parameter is valid and mandatory only when charge_mode is set to prePaid. Options:
|
period_num |
No |
Integer |
Parameter description: number of periods for subscribing to an IoTDA instance. This parameter is valid and mandatory only when charge_mode is set to prePaid. Value: If period_type is set to month, the value ranges from 1 to 9. If period_type is set to year, the value ranges from 1 to 3. Minimum: 1 Maximum: 9 |
is_auto_renew |
No |
Boolean |
Parameter description: whether to automatically renew the subscription, specified during yearly/monthly instance creation. The renewal period is the same as the original period, and the payment is automatically made during the renewal. Options:
Default: false |
is_auto_pay |
No |
Boolean |
Parameter description: whether to automatically pay from the customer's account. This parameter can be specified when a yearly/monthly instance is created. This parameter does not affect the payment mode of automatic renewal. Value: true: automatic payment. Fees are automatically deducted from the account balance. false: default value. Orders are submitted but not paid. Default: false |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
key |
Yes |
String |
Parameter description: tag key. Use letters, digits, spaces, and special characters (_.:=+-@). No space is allowed at the beginning or end. Minimum: 1 Maximum: 128 |
value |
No |
String |
Parameter description: tag value, which can be an empty string or null. Use letters, digits, spaces, and special characters (_.:=+-@). Minimum: 0 Maximum: 255 |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
vpc_id |
Yes |
String |
Parameter description: VPC ID of the instance of the enterprise edition. |
subnet_id |
Yes |
String |
Parameter description: subnet ID of the instance of the enterprise edition. |
security_group_id |
Yes |
String |
Parameter description: security group ID of the instance of the enterprise edition. Ensure that port 22 (Linux SSH login), port 3389 (Windows remote login), and ICMP (Ping) have been enabled for the selected security group. |
smn_topic_urn |
No |
String |
Parameter description: SMN topic URN. When an instance of the enterprise edition is successfully created, the platform sends notifications through this topic. |
ciphering_algorithm |
No |
String |
Parameter description: encryption algorithm supported by the instance. Options:
Default: COMMON_ALGORITHM |
port_info |
Yes |
Port object |
Port information of the enterprise edition. This parameter is mandatory when you create an enterprise instance. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
app_https_port |
No |
Integer |
Parameter description: HTTPS port for application access. The default value is 443. Minimum: 0 Maximum: 65535 Default: 443 |
app_amqps_port |
No |
Integer |
Parameter description: AMQP port for application access. The default value is 5671. Minimum: 0 Maximum: 65535 Default: 5671 |
device_coap_port |
No |
Integer |
Parameter description: CoAP port for device access. The default value is 5683. Minimum: 0 Maximum: 65535 Default: 5683 |
device_coaps_port |
No |
Integer |
Parameter description: CoAPS port for device access. The default value is 5684. Minimum: 0 Maximum: 65535 Default: 5684 |
device_mqtt_port |
No |
Integer |
Parameter description: MQTT port for device access. The default value is 1883. Minimum: 0 Maximum: 65535 Default: 1883 |
device_mqtts_port |
No |
Integer |
Parameter description: MQTTS port for device access. The default value is 8883. Minimum: 0 Maximum: 65535 Default: 8883 |
device_https_port |
No |
Integer |
Parameter description: HTTPS port for device access. The default value is 443. Minimum: 0 Maximum: 65535 Default: 443 |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
instance_type |
String |
Parameter description: instance type. Options:
|
instance_id |
String |
Parameter description: instance ID. Value: Enter up to 36 characters, including lowercase letters (a-f), digits, and hyphens (-). |
name |
String |
Parameter description: instance name. Value: Enter 1 to 64 characters, including letters, digits, underscores (_), and hyphens (-). |
flavor |
Flavor object |
Parameter description: specifications of an IoTDA instance. |
status |
String |
Parameter description: instance status. Options:
Minimum: 0 Maximum: 64 |
charge_info |
ChargeInfo object |
Parameter description: billing information of an IoTDA instance. |
description |
String |
Parameter description: description of an IoTDA instance. Value: The value can contain a maximum of 256 characters. Use only letters, digits, and special characters (_,.&-). |
enterprise_project_id |
String |
Parameter description: enterprise project ID. |
tags |
Array of Tag objects |
Parameter description: tag information of an IoTDA instance. This field has values if the instance has tags. Or, it is left empty. Array Length: 0 - 20 |
order_id |
String |
Parameter description: order ID. This parameter is returned when a yearly/monthly instance is created. Minimum: 0 Maximum: 64 |
additional_params |
AdditionalParams object |
Additional parameter information of the enterprise edition. |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Parameter description: specification name of the IoTDA instance to create. For details, see Specifications. |
size |
Integer |
Parameter description: unit number of the standard IoTDA instances to create. For details, see Specifications. This parameter is mandatory when instance_type is set to standard. Minimum: 1 Maximum: 200 |
Parameter |
Type |
Description |
---|---|---|
charge_mode |
String |
Parameter description: payment mode of the instance. Options:
|
period_type |
String |
Parameter description: period type of the subscribed IoTDA instance. This parameter is valid and mandatory only when charge_mode is set to prePaid. Options:
|
period_num |
Integer |
Parameter description: number of periods for subscribing to an IoTDA instance. This parameter is valid and mandatory only when charge_mode is set to prePaid. Value: If period_type is set to month, the value ranges from 1 to 9. If period_type is set to year, the value ranges from 1 to 3. Minimum: 1 Maximum: 9 |
is_auto_renew |
Boolean |
Parameter description: whether to automatically renew the subscription, specified during yearly/monthly instance creation. The renewal period is the same as the original period, and the payment is automatically made during the renewal. Options:
Default: false |
is_auto_pay |
Boolean |
Parameter description: whether to automatically pay from the customer's account. This parameter can be specified when a yearly/monthly instance is created. This parameter does not affect the payment mode of automatic renewal. Value: true: automatic payment. Fees are automatically deducted from the account balance. false: default value. Orders are submitted but not paid. Default: false |
Parameter |
Type |
Description |
---|---|---|
key |
String |
Parameter description: tag key. Use letters, digits, spaces, and special characters (_.:=+-@). No space is allowed at the beginning or end. Minimum: 1 Maximum: 128 |
value |
String |
Parameter description: tag value, which can be an empty string or null. Use letters, digits, spaces, and special characters (_.:=+-@). Minimum: 0 Maximum: 255 |
Parameter |
Type |
Description |
---|---|---|
vpc_id |
String |
Parameter description: VPC ID of the instance of the enterprise edition. |
subnet_id |
String |
Parameter description: subnet ID of the instance of the enterprise edition. |
security_group_id |
String |
Parameter description: security group ID of the instance of the enterprise edition. Ensure that port 22 (Linux SSH login), port 3389 (Windows remote login), and ICMP (Ping) have been enabled for the selected security group. |
smn_topic_urn |
String |
Parameter description: SMN topic URN. When an instance of the enterprise edition is successfully created, the platform sends notifications through this topic. |
ciphering_algorithm |
String |
Parameter description: encryption algorithm supported by the instance. Options:
Default: COMMON_ALGORITHM |
port_info |
Port object |
Port information of the enterprise edition. This parameter is mandatory when you create an enterprise instance. |
Parameter |
Type |
Description |
---|---|---|
app_https_port |
Integer |
Parameter description: HTTPS port for application access. The default value is 443. Minimum: 0 Maximum: 65535 Default: 443 |
app_amqps_port |
Integer |
Parameter description: AMQP port for application access. The default value is 5671. Minimum: 0 Maximum: 65535 Default: 5671 |
device_coap_port |
Integer |
Parameter description: CoAP port for device access. The default value is 5683. Minimum: 0 Maximum: 65535 Default: 5683 |
device_coaps_port |
Integer |
Parameter description: CoAPS port for device access. The default value is 5684. Minimum: 0 Maximum: 65535 Default: 5684 |
device_mqtt_port |
Integer |
Parameter description: MQTT port for device access. The default value is 1883. Minimum: 0 Maximum: 65535 Default: 1883 |
device_mqtts_port |
Integer |
Parameter description: MQTTS port for device access. The default value is 8883. Minimum: 0 Maximum: 65535 Default: 8883 |
device_https_port |
Integer |
Parameter description: HTTPS port for device access. The default value is 443. Minimum: 0 Maximum: 65535 Default: 443 |
Example Requests
-
Create an instance. Specifications: standard intermediate-frequency units, 2 units, and yearly billing.
POST https://{endpoint}/v5/iot/{project_id}/iotda-instances { "instance_type" : "standard", "flavor" : { "type" : "iotda.standard.s1", "size" : 2 }, "name" : "iotda_instance", "charge_info" : { "charge_mode" : "prePaid", "period_type" : "year", "period_num" : 1, "is_auto_renew" : "true", "is_auto_pay" : "false" }, "description" : "IoTDA instance for production.", "enterprise_project_id" : "d22e47e9-cfad-4254-8a29-d2a56a07681d", "tags" : [ { "key" : "testTagName", "value" : "testTagValue" } ] }
-
Create an instance. Specifications: standard intermediate-frequency units, 2 units, and pay-per-use billing.
POST https://{endpoint}/v5/iot/{project_id}/iotda-instances { "instance_type" : "standard", "flavor" : { "type" : "iotda.standard.s2", "size" : 2 }, "name" : "iotda_instance", "charge_info" : { "charge_mode" : "postPaid" }, "description" : "IoTDA instance for production.", "enterprise_project_id" : "d22e47e9-cfad-4254-8a29-d2a56a07681d" }
-
Create an instance. Specifications: enterprise edition and yearly billing.
POST https://{endpoint}/v5/iot/{project_id}/iotda-instances { "instance_type" : "enterprise", "flavor" : { "type" : "iotda.enterprise.1000tps.10wonlinedevice" }, "name" : "iotda_enterprise_instance", "charge_info" : { "charge_mode" : "prePaid", "period_type" : "year", "period_num" : 1, "is_auto_renew" : "true", "is_auto_pay" : "false" }, "description" : "IoTDA instance for production.", "enterprise_project_id" : "d22e47e9-cfad-4254-8a29-d2a56a07681d", "additional_params" : { "vpc_id" : "40926909-d411-45dd-a8b4-1ebc36512345", "subnet_id" : "088c7d8a-f49e-4f5f-bd33-ce9b6b712345", "security_group_id" : "55980b43-f006-4dbf-ab58-9b0d9e712345", "smn_topic_urn" : "urn:smn:cn-north-7:08aaee8ae000d5182f26c00199812345:iotda_instance_create", "ciphering_algorithm" : "COMMON_ALGORITHM", "port_info" : { "app_https_port" : "443", "app_amqps_port" : "5671", "device_coap_port" : "5683", "device_coaps_port" : "5684", "device_mqtt_port" : "1883", "device_mqtts_port" : "8883", "device_https_port" : "443" } } }
Example Responses
Status code: 200
OK
{ "instance_type" : "standard", "instance_id" : "8561675c-d8a3-4956-9884-9cf9cbdd3134", "flavor" : { "type" : "iotda.standard.s2", "size" : 2 }, "status" : "CREATING", "charge_info" : { "charge_mode" : "prePaid", "period_type" : "year", "period_num" : 1, "is_auto_renew" : true, "is_auto_pay" : false }, "description" : "IoTDA instance for production.", "enterprise_project_id" : "d22e47e9-cfad-4254-8a29-d2a56a07681d", "tags" : [ { "key" : "testTagName", "value" : "testTagValue" } ], "order_id" : "CS22121614500ABCD", "additional_params" : null }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
400 |
Bad Request |
401 |
Unauthorized |
403 |
Forbidden |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot