O recurso ALIYUN::IOT::Device registra um dispositivo.
Regiões com suporte:
China (Shanghai)
Singapura (Singapura)
Japão (Tóquio)
Alemanha (Frankfurt)
EUA (Vale do Silício)
EUA (Virgínia)
Sintaxe
{
"Type": "ALIYUN::IOT::Device",
"Properties": {
"DeviceName": String,
"IotInstanceId": String,
"ProductKey": String,
"PinCode": String,
"DevEui": String,
"Nickname": String
}
}
Propriedades
| Parâmetro | Tipo | Obrigatório | Editável | Descrição | Restrição |
| DeviceName | String | Não | Liberado | Nome do dispositivo. Se não especificado, o sistema gera um nome aleatoriamente. | Deve ter de 4 a 32 caracteres e pode conter letras, dígitos e os seguintes caracteres especiais:
|
| IotInstanceId | String | Não | Liberado | ID da instância. | Não necessário para instâncias públicas. |
| ProductKey | String | Sim | Não suportado | Identificador do produto ao qual o dispositivo pertence. O ProductKey é um identificador globalmente único na IoT Platform. Consulte o console da IoT Platform ou chame a API QueryProductList para visualizar todos os produtos da sua conta. |
Nenhuma |
| PinCode | String | Não | Liberado | Código PIN LoRaWAN usado para verificar o DevEUI. | Obrigatório ao criar dispositivos LoRaWAN. |
| DevEui | String | Não | Liberado | DevEUI do dispositivo LoRaWAN. | Obrigatório ao criar dispositivos LoRaWAN. |
| Nickname | String | Não | Liberado | Apelido do dispositivo. Se omitido, nenhum apelido será gerado. | Deve ter de 4 a 64 caracteres. Pode conter letras, dígitos e sublinhados (_). Nota Um caractere chinês ocupa 2 caracteres. |
Valores de retorno
Fn::GetAtt
DeviceName: nome do dispositivo.
NodeType: tipo de nó do produto.
IotInstanceId: ID da instância.
ProductKey: chave do produto.
NickName: apelido do dispositivo.
IotId: ID exclusivo emitido pela IoT Platform para o dispositivo.
ProductName: nome do produto.
DeviceSecret: segredo do dispositivo.
IpAddress: endereço IP.
Exemplos
Formato JSON
{
"ROSTemplateFormatVersion": "2015-09-01",
"Resources": {
"Device": {
"Type": "ALIYUN::IOT::Device",
"Properties": {
"DeviceName": {
"Ref": "DeviceName"
},
"IotInstanceId": {
"Ref": "IotInstanceId"
},
"ProductKey": {
"Ref": "ProductKey"
},
"PinCode": {
"Ref": "PinCode"
},
"DevEui": {
"Ref": "DevEui"
},
"Nickname": {
"Ref": "Nickname"
}
}
}
},
"Parameters": {
"DeviceName": {
"Type": "String",
"Description": "The name of the device that you want to register. The device name must consist of\n4 to 32 characters, including English letters, digits, and special characters, for\nexample, hyphens (-), underscores (_), at signs (@), periods (.) , and colons (:).\nDeviceName is used with ProductKey to identify a specified device.\nNote If you do not specify this parameter, the system will generate a name for the device."
},
"IotInstanceId": {
"Type": "String",
"Description": "Public instance does not pass this parameter; instance that you need to buy the incoming instance ID."
},
"ProductKey": {
"Type": "String",
"Description": "The identifier of the product to which the device to be registered belongs."
},
"PinCode": {
"Type": "String",
"Description": "PIN Code LoRaWAN device for checking the legitimacy of DevEUI.\nWhen you create a LoRaWAN devices, this will pass."
},
"DevEui": {
"Type": "String",
"Description": "DevEUI LoRaWAN equipment.\nWhen you create a LoRaWAN devices, this will pass."
},
"Nickname": {
"Type": "String",
"Description": "Add a nickname for the device. A nickname can be 4-64 characters in length, and can\ncontain Chinese characters, English letters, numbers and underscores (_). A Chinese\ncharacter counts as two characters."
}
},
"Outputs": {
"DeviceName": {
"Description": "Device name.",
"Value": {
"Fn::GetAtt": [
"Device",
"DeviceName"
]
}
},
"NodeType": {
"Description": "Node type.",
"Value": {
"Fn::GetAtt": [
"Device",
"NodeType"
]
}
},
"IotInstanceId": {
"Description": "IOT instance ID.",
"Value": {
"Fn::GetAtt": [
"Device",
"IotInstanceId"
]
}
},
"ProductKey": {
"Description": "Product key.",
"Value": {
"Fn::GetAtt": [
"Device",
"ProductKey"
]
}
},
"IpAddress": {
"Description": "IP address.",
"Value": {
"Fn::GetAtt": [
"Device",
"IpAddress"
]
}
},
"DeviceSecret": {
"Description": "Device key.",
"Value": {
"Fn::GetAtt": [
"Device",
"DeviceSecret"
]
}
},
"ProductName": {
"Description": "Product name.",
"Value": {
"Fn::GetAtt": [
"Device",
"ProductName"
]
}
},
"IotId": {
"Description": "Things internet device ID issued for the device, as the unique identifier of the device.\nDescription Keep, do not leak.",
"Value": {
"Fn::GetAtt": [
"Device",
"IotId"
]
}
},
"NickName": {
"Description": "Nick name.",
"Value": {
"Fn::GetAtt": [
"Device",
"NickName"
]
}
}
}
}
Formato YAML
ROSTemplateFormatVersion: '2015-09-01'
Resources:
Device:
Type: 'ALIYUN::IOT::Device'
Properties:
DeviceName:
Ref: DeviceName
IotInstanceId:
Ref: IotInstanceId
ProductKey:
Ref: ProductKey
PinCode:
Ref: PinCode
DevEui:
Ref: DevEui
Nickname:
Ref: Nickname
Parameters:
DeviceName:
Type: String
Description: >-
The name of the device that you want to register. The device name must
consist of
4 to 32 characters, including English letters, digits, and special
characters, for
example, hyphens (-), underscores (_), at signs (@), periods (.) , and
colons (:).
DeviceName is used with ProductKey to identify a specified device.
Note If you do not specify this parameter and the system will generate a name
for the device.
IotInstanceId:
Type: String
Description: >-
Public instance does not pass this parameter; instance that you need to
buy the incoming instance ID.
ProductKey:
Type: String
Description: >-
The identifier of the product to which the device to be registered
belongs.
PinCode:
Type: String
Description: |-
PIN Code LoRaWAN device for checking the legitimacy of DevEUI.
When you create a LoRaWAN devices, this will pass.
DevEui:
Type: String
Description: |-
DevEUI LoRaWAN equipment.
When you create a LoRaWAN devices, this will pass.
Nickname:
Type: String
Description: >-
Add a nickname for the device. A nickname can be 4-64 characters in
length, and can
contain Chinese characters, English letters, numbers and underscores (_).
A Chinese
character counts as two characters.
Outputs:
DeviceName:
Description: Device name.
Value:
'Fn::GetAtt':
-Device
-DeviceName
NodeType:
Description: Node type.
Value:
'Fn::GetAtt':
-Device
-NodeType
IotInstanceId:
Description: IOT instance ID.
Value:
'Fn::GetAtt':
-Device
-IotInstanceId
ProductKey:
Description: Product key.
Value:
'Fn::GetAtt':
-Device
-ProductKey
IpAddress:
Description: IP address.
Value:
'Fn::GetAtt':
-Device
-IpAddress
DeviceSecret:
Description: Device key.
Value:
'Fn::GetAtt':
-Device
-DeviceSecret
ProductName:
Description: Product name.
Value:
'Fn::GetAtt':
-Device
-ProductName
IotId:
Description: >-
Things internet device ID issued for the device and as the unique identifier
of the device.
Description Keep, do not leak.
Value:
'Fn::GetAtt':
-Device
-IotId
NickName:
Description: Nick name.
Value:
'Fn::GetAtt':
-Device
-NickName