The ALIYUN::IOT::Product resource creates a product.
Products can be created in the following regions:
- Shanghai
- Singapore
- Japan (Tokyo)
- Germany (Frankfurt)
- US (Silicon Valley)
- US (Virginia)
Syntax
{
"Type": "ALIYUN::IOT::Product",
"Properties": {
"AuthType": String,
"NodeType": Integer,
"Description": String,
"CategoryKey": String,
"IotInstanceId": String,
"ProtocolType": String,
"PublishAuto": Boolean,
"Id2": Boolean,
"ProductName": String,
"ResourceGroupId": String,
"DataFormat": Integer,
"AliyunCommodityCode": String,
"JoinPermissionId": String,
"NetType": String
}
}Properties
| Property | Type | Required | Update allowed | Description | Constraints |
| AuthType | String | No | No | The authentication method for devices of the product to connect to IoT Platform. | Valid values:
|
| NodeType | Integer | Yes | No | The node type of the product. | This parameter is specific to products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior). Valid values:
|
| Description | String | No | Yes | The description of the product. | None |
| CategoryKey | String | No | No | The identifier of the product category. | If you specify this parameter, the created product uses the Thing Specification Language model of the specified category. If you do not specify this parameter, no standard Thing Specification Language model is used. |
| IotInstanceId | String | No | No | The instance ID. | Do not specify this parameter for public instances. |
| ProtocolType | String | No | No | The protocol for devices to connect to a gateway. | This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior) and whose devices connect to IoT Platform through a gateway. Valid values:
|
| PublishAuto | Boolean | No | No | Specifies whether to automatically publish the Thing Specification Language model after the product is created. | Valid values:
|
| Id2 | Boolean | No | No | Specifies whether to use ID²-based authentication. | Valid values:
|
| ProductName | String | Yes | Yes | The name of the new product. | The name must be 4 to 30 characters in length and can contain Chinese characters, uppercase letters, lowercase letters, digits, and underscores (_). Note A Chinese character occupies two character positions. |
| ResourceGroupId | String | No | Yes | The ID of the resource group. | None |
| DataFormat | Integer | No | No | The data format of the product. | This parameter is specific to products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior). Valid values:
|
| AliyunCommodityCode | String | No | No | The product type. | Valid values:
|
| JoinPermissionId | String | No | No | The ID of the LoRaWAN join permission. | This parameter is required when NetType is set to LORA. |
| NetType | String | No | No | The connection method. | This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior) and whose devices are gateways or devices that do not connect to a gateway. Valid values:
|
Return value
Fn::GetAtt
- ProductKey: The unique identifier of the product.
- IotInstanceId: The ID of the IoT Platform instance.
Examples
JSON format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Product": {
"Type": "ALIYUN::IOT::Product",
"Properties": {
"AuthType": {
"Ref": "AuthType"
},
"NodeType": {
"Ref": "NodeType"
},
"Description": {
"Ref": "Description"
},
"CategoryKey": {
"Ref": "CategoryKey"
},
"IotInstanceId": {
"Ref": "IotInstanceId"
},
"ProtocolType": {
"Ref": "ProtocolType"
},
"PublishAuto": {
"Ref": "PublishAuto"
},
"Id2": {
"Ref": "Id2"
},
"ProductName": {
"Ref": "ProductName"
},
"ResourceGroupId": {
"Ref": "ResourceGroupId"
},
"DataFormat": {
"Ref": "DataFormat"
},
"AliyunCommodityCode": {
"Ref": "AliyunCommodityCode"
},
"JoinPermissionId": {
"Ref": "JoinPermissionId"
},
"NetType": {
"Ref": "NetType"
}
}
}
},
"Parameters": {
"AuthType": {
"Type": "String",
"Description": "The authentication method for devices of the product to connect to IoT Platform. Valid values: secret, id2, x509. If you do not specify this parameter, the default value is secret."
},
"NodeType": {
"Type": "Number",
"Description": "The node type of the product. Values:\n0: Device. A device cannot be mounted with sub-devices. It can connect to IoT Platform\neither directly or as a sub-device of a gateway.\n1: Gateway. A gateway can be mounted with sub-devices. It can manage sub-devices, maintain\nthe topological relationships with sub-devices, and synchronize the topological relationships\nto IoT Platform.",
"AllowedValues": [
0,
1
]
},
"Description": {
"Type": "String",
"Description": "The description of the product."
},
"CategoryKey": {
"Type": "String",
"Description": "The identifier of the product category. If you specify this parameter, the created product uses the Thing Specification Language model of the specified category. If you do not specify this parameter, no standard Thing Specification Language model is used. To obtain the CategoryKey of a predefined category on IoT Platform, call the ListThingTemplates operation."
},
"IotInstanceId": {
"Type": "String",
"Description": "The ID of the instance. Do not specify this parameter for public instances."
},
"ProtocolType": {
"Type": "String",
"Description": "The protocol that devices of this product use to connect to gateways.\nSet this parameter only if you are creating a product whose devices will be connected\nto gateways.\nOptions:\nmodbus: Modbus.\nopc-ua: OPC UA.\ncustomize: Customized protocol.\nble: BLE.\nzigbee: ZigBee.",
"AllowedValues": [
"ble",
"customize",
"modbus",
"opc-ua",
"zigbee"
]
},
"PublishAuto": {
"Type": "Boolean",
"Description": "Specifies whether to automatically publish the Thing Specification Language model after the product is created. Valid values: true (default), false.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"Id2": {
"Type": "Boolean",
"Description": "Specifies whether to use ID²-based authentication. Valid values: true, false (default). Note: Only the China (Shanghai) region supports ID²-based authentication. If this parameter is set to true but the value of AuthType is not id2, the system uses the value of AuthType.",
"AllowedValues": [
"True",
"true",
"False",
"false"
]
},
"ProductName": {
"Type": "String",
"Description": "The name of the product. A product name must be 4 to 30 characters in length and can\ncontain Chinese characters, English letters, digits, and underscores (_).\nNote: A product name must be unique within an account."
},
"ResourceGroupId": {
"Type": "String",
"Description": "The ID of the resource group to which the product belongs. You can view the resource group ID in the Resource Management console. If you do not specify this parameter, the product is added to the default resource group."
},
"DataFormat": {
"Type": "Number",
"Description": "The data format of the product. This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior). Valid values: 0 (Pass-through/Custom), 1 (Alink JSON).",
"AllowedValues": [
0,
1
]
},
"AliyunCommodityCode": {
"Type": "String",
"Description": "The product type. Valid values: iothub_senior (Uses a Thing Specification Language model), iothub (Does not use a Thing Specification Language model). If you do not specify this parameter, the default value is iothub."
},
"JoinPermissionId": {
"Type": "String",
"Description": "The ID of the LoRaWAN join permission. This parameter is required when NetType is set to LORA. To query the JoinPermissionId of LoRaWAN join permissions under your account, call the QueryLoRaJoinPermissions operation. If you do not have a LoRaWAN join permission, create one in the IoT Platform console."
},
"NetType": {
"Type": "String",
"Description": "The connection method. This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior) and whose devices are gateways or devices that do not connect to a gateway. Valid values: WIFI (default), CELLULAR, ETHERNET, LORA, OTHER.",
"AllowedValues": [
"CELLULAR",
"ETHERNET",
"LORA",
"OTHER",
"WIFI"
]
}
},
"Outputs": {
"ProductKey": {
"Description": "The globally unique identifier of the product issued by IoT Platform.",
"Value": {
"Fn::GetAtt": [
"Product",
"ProductKey"
]
}
},
"IotInstanceId": {
"Description": "The ID of the IoT Platform instance.",
"Value": {
"Fn::GetAtt": [
"Product",
"IotInstanceId"
]
}
}
}
}YAML format
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Product:
Type: 'ALIYUN::IOT::Product'
Properties:
AuthType:
Ref: AuthType
NodeType:
Ref: NodeType
Description:
Ref: Description
CategoryKey:
Ref: CategoryKey
IotInstanceId:
Ref: IotInstanceId
ProtocolType:
Ref: ProtocolType
PublishAuto:
Ref: PublishAuto
Id2:
Ref: Id2
ProductName:
Ref: ProductName
ResourceGroupId:
Ref: ResourceGroupId
DataFormat:
Ref: DataFormat
AliyunCommodityCode:
Ref: AliyunCommodityCode
JoinPermissionId:
Ref: JoinPermissionId
NetType:
Ref: NetType
Parameters:
AuthType:
Type: String
Description: The authentication method for devices of the product to connect to IoT Platform. Valid values: secret, id2, x509. If you do not specify this parameter, the default value is secret.
NodeType:
Type: Number
Description: >-
The node type of the product. Values:
0: Device. A device cannot be mounted with sub-devices. It can connect to
IoT Platform
either directly or as a sub-device of a gateway.
1: Gateway. A gateway can be mounted with sub-devices. It can manage
sub-devices, maintain
the topological relationships with sub-devices, and synchronize the
topological relationships
to IoT Platform.
AllowedValues:
- 0
- 1
Description:
Type: String
Description: The description of the product.
CategoryKey:
Type: String
Description: >-
The identifier of the product category. If you specify this parameter, the created product uses the Thing Specification Language model of the specified category. If you do not specify this parameter, no standard Thing Specification Language model is used. To obtain the CategoryKey of a predefined category on IoT Platform, call the ListThingTemplates operation.
IotInstanceId:
Type: String
Description: 'The ID of the instance. Do not specify this parameter for public instances.'
ProtocolType:
Type: String
Description: >-
The protocol that devices of this product use to connect to gateways.
Set this parameter only if you are creating a product whose devices will
be connected
to gateways.
Options:
modbus: Modbus.
opc-ua: OPC UA.
customize: Customized protocol.
ble: BLE.
zigbee: ZigBee.
AllowedValues:
- ble
- customize
- modbus
- opc-ua
- zigbee
PublishAuto:
Type: Boolean
Description: 'Specifies whether to automatically publish the Thing Specification Language model after the product is created. Valid values: true (default), false.'
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
Id2:
Type: Boolean
Description: >-
Specifies whether to use ID²-based authentication. Valid values: true, false (default). Note: Only the China (Shanghai) region supports ID²-based authentication. If this parameter is set to true but the value of AuthType is not id2, the system uses the value of AuthType.
AllowedValues:
- 'True'
- 'true'
- 'False'
- 'false'
ProductName:
Type: String
Description: >-
The name of the product. A product name must be 4 to 30 characters in
length and can
contain Chinese characters, English letters, digits, and underscores (_).
Note: A product name must be unique within an account.
ResourceGroupId:
Type: String
Description: >-
The ID of the resource group to which the product belongs. You can view the resource group ID in the Resource Management console. If you do not specify this parameter, the product is added to the default resource group.
DataFormat:
Type: Number
Description: >-
The data format of the product. This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior). Valid values: 0 (Pass-through/Custom), 1 (Alink JSON).
AllowedValues:
- 0
- 1
AliyunCommodityCode:
Type: String
Description: >-
The product type. Valid values: iothub_senior (Uses a Thing Specification Language model), iothub (Does not use a Thing Specification Language model). If you do not specify this parameter, the default value is iothub.
JoinPermissionId:
Type: String
Description: >-
The ID of the LoRaWAN join permission. This parameter is required when NetType is set to LORA. To query the JoinPermissionId of LoRaWAN join permissions under your account, call the QueryLoRaJoinPermissions operation. If you do not have a LoRaWAN join permission, create one in the IoT Platform console.
NetType:
Type: String
Description: >-
The connection method. This parameter is required for products that use the Thing Specification Language model (AliyunCommodityCode=iothub_senior) and whose devices are gateways or devices that do not connect to a gateway. Valid values: WIFI (default), CELLULAR, ETHERNET, LORA, OTHER.
AllowedValues:
- CELLULAR
- ETHERNET
- LORA
- OTHER
- WIFI
Outputs:
ProductKey:
Description: The globally unique identifier of the product issued by IoT Platform.
Value:
'Fn::GetAtt':
- Product
- ProductKey
IotInstanceId:
Description: The ID of the IoT Platform instance.
Value:
'Fn::GetAtt':
- Product
- IotInstanceId该文章对您有帮助吗?