创建设备接入实例
功能介绍
URI
POST /v5/iot/{project_id}/iotda-instances
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| project_id | 是 | String | 参数说明 :项目ID。获取方法请参见 获取项目ID。 |
请求参数
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| instance_type | 是 | String | 参数说明:创建的实例类型。实例类型说明参见产品规格说明。 取值范围: |
| flavor | 是 | Flavor object | 参数说明:设备接入实例的规格参数。 |
| name | 是 | String | 参数说明:实例名称 取值范围:由中文字符,英文字母、数字及“_”、“-”组成,且长度为[1-64]个字符。 |
| charge_info | 是 | ChargeInfo object | 参数说明:设备接入实例计费信息 |
| description | 否 | String | 参数说明:设备接入实例的描述信息。 取值范围:长度不超过256,只允许中文、字母、数字、以及_,,.。、&-等字符的组合 |
| enterprise_project_id | 否 | String | 参数说明:企业项目Id。此字段填写明确的企业项目Id或者0(表示默认企业项目Id)时支持企业项目特性。可以企业项目管理服务中获取。 取值范围:长度不超过36,由小写字母[a-f]、数字、连接符(-)的组成。 |
| tags | 否 | Array of Tag objects | 参数说明:设备接入实例的标签信息。 |
| additional_params | 否 | AdditionalParams object | 企业版附加参数信息。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| type | 是 | String | 参数说明:待创建设备接入实例的规格名称。详情请参见产品规格说明中的规格编码。 |
| size | 否 | Integer | 参数说明:待创建设备接入实例的单元数量,企业版不支持该参数。详情请参见产品规格说明。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| key | 是 | String | 参数说明:标签键,标签的键可用字母(包含中文)、数字、空格和以下字符:下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@,首尾不能有空格字符。 |
| value | 否 | String | 参数说明:标签值,可为空字符串和null,标签的值可用字母(包含中文)、数字、空格和以下字符:下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| vpc_id | 是 | String | 参数说明:企业版实例的VPCID。 |
| subnet_id | 是 | String | 参数说明:企业版实例的子网ID。 |
| security_group_id | 是 | String | 参数说明:企业版实例的安全组ID。请确保所选安全组已放通22端口(Linux SSH登录),3389端口(Windows远程登录)和ICMP协议(Ping)。 |
| smn_topic_urn | 否 | String | 参数说明:SMN的topic urn, 当企业版实例创建成功时,平台将通过该topic发送通知。 |
| ciphering_algorithm | 否 | String | 参数说明:实例支持的加密算法。 取值范围: |
| port_info | 是 | Port object | 企业版端口信息。创建企业版实例时必填。 |
| 参数 | 是否必选 | 参数类型 | 描述 |
|---|---|---|---|
| app_https_port | 否 | Integer | 参数说明:应用接入HTTPS协议端口,默认值:443。 |
| app_amqps_port | 否 | Integer | 参数说明:应用接入AMQP协议端口, 默认值:5671。 |
| app_mqtts_port | 否 | Integer | 参数说明:应用接入MQTTS协议端口, 默认值:8883。 |
| device_coap_port | 否 | Integer | 参数说明:设备接入COAP协议端口, 默认值:5683。 |
| device_coaps_port | 否 | Integer | 参数说明:设备接入COAPS协议端口, 默认值:5684。 |
| device_mqtt_port | 否 | Integer | 参数说明:设备接入MQTT协议端口, 默认值:1883。 |
| device_mqtts_port | 否 | Integer | 参数说明:设备接入MQTTS协议端口, 默认值:8883。 |
| device_https_port | 否 | Integer | 参数说明:设备接入HTTPS协议端口, 默认值:443。 |
响应参数
状态码:200
| 参数 | 参数类型 | 描述 |
|---|---|---|
| instance_type | String | 参数说明:实例类型。 取值范围: |
| instance_id | String | 参数说明:实例ID。 取值范围:长度不超过36,由小写字母[a-f]、数字、连接符(-)的组成。 |
| name | String | 参数说明:实例名称 取值范围:由中文字符,英文字母、数字及“_”、“-”组成,且长度为[1-64]个字符。 |
| flavor | Flavor object | 参数说明:设备接入实例的规格参数。 |
| status | String | 参数说明:实例状态。 取值范围: |
| charge_info | ChargeInfo object | 参数说明:设备接入实例计费信息 |
| description | String | 参数说明:设备接入实例的描述信息。 取值范围:长度不超过256,只允许中文、字母、数字、以及_,,.。、&-等字符的组合。 |
| enterprise_project_id | String | 参数说明:企业项目Id。 |
| tags | Array of Tag objects | 参数说明: 设备接入实例的标签信息。如果实例有标签,则会有该字段,否则该字段为空。 |
| order_id | String | 参数说明:订单号。 |
| additional_params | AdditionalParams object | 企业版附加参数信息。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| type | String | 参数说明:待创建设备接入实例的规格名称。详情请参见产品规格说明中的规格编码。 |
| size | Integer | 参数说明:待创建设备接入实例的单元数量,企业版不支持该参数。详情请参见产品规格说明。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| key | String | 参数说明:标签键,标签的键可用字母(包含中文)、数字、空格和以下字符:下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@,首尾不能有空格字符。 |
| value | String | 参数说明:标签值,可为空字符串和null,标签的值可用字母(包含中文)、数字、空格和以下字符:下划线(_)点(.)冒号(:)等号(=)加号(+)中划线(-)以及@。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| vpc_id | String | 参数说明:企业版实例的VPCID。 |
| subnet_id | String | 参数说明:企业版实例的子网ID。 |
| security_group_id | String | 参数说明:企业版实例的安全组ID。请确保所选安全组已放通22端口(Linux SSH登录),3389端口(Windows远程登录)和ICMP协议(Ping)。 |
| smn_topic_urn | String | 参数说明:SMN的topic urn, 当企业版实例创建成功时,平台将通过该topic发送通知。 |
| ciphering_algorithm | String | 参数说明:实例支持的加密算法。 取值范围: |
| port_info | Port object | 企业版端口信息。创建企业版实例时必填。 |
| 参数 | 参数类型 | 描述 |
|---|---|---|
| app_https_port | Integer | 参数说明:应用接入HTTPS协议端口,默认值:443。 |
| app_amqps_port | Integer | 参数说明:应用接入AMQP协议端口, 默认值:5671。 |
| app_mqtts_port | Integer | 参数说明:应用接入MQTTS协议端口, 默认值:8883。 |
| device_coap_port | Integer | 参数说明:设备接入COAP协议端口, 默认值:5683。 |
| device_coaps_port | Integer | 参数说明:设备接入COAPS协议端口, 默认值:5684。 |
| device_mqtt_port | Integer | 参数说明:设备接入MQTT协议端口, 默认值:1883。 |
| device_mqtts_port | Integer | 参数说明:设备接入MQTTS协议端口, 默认值:8883。 |
| device_https_port | Integer | 参数说明:设备接入HTTPS协议端口, 默认值:443。 |
请求示例
-
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" } } }
响应示例
状态码: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
} 状态码
| 状态码 | 描述 |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 401 | Unauthorized |
| 403 | Forbidden |
错误码
请参见错误码。