ALIYUN::IOT::ProductTopic は、指定された製品のトピックカテゴリを作成するために使用されます。
構文
{
"Type": "ALIYUN::IOT::ProductTopic",
"Properties": {
"Desc": String,
"IotInstanceId": String,
"TopicShortName": String,
"Operation": String,
"ProductKey": String
}
}プロパティ
| プロパティ | タイプ | 必須 | 編集可能 | 説明 | 制約 |
| Desc | String | いいえ | はい | トピックカテゴリの説明。 | 説明は最大 100 文字です。 |
| IotInstanceId | String | いいえ | いいえ | インスタンスの ID。 | このパラメーターは Enterprise Edition インスタンスでは必須ですが、パブリックインスタンスでは必須ではありません。 |
| TopicShortName | String | はい | はい | トピックカテゴリ内のカスタムカテゴリ階層。 | デフォルトでは、トピックカテゴリには、システム定義のカテゴリ階層 _productKey_ と _deviceName_ が含まれています。階層はスラッシュ (/) で区切ります。トピックカテゴリの形式: productKey/deviceName/topicShortName。各カテゴリ階層の名前には、英字、数字、アンダースコア (_) のみを含めることができ、空にすることはできません。 |
| Operation | String | はい | はい | トピックカテゴリに対するデバイスの操作権限。 | 有効な値:
|
| ProductKey | String | はい | いいえ | トピックカテゴリを作成する製品の一意の識別子。 | なし |
レスポンスパラメーター
Fn::GetAtt
TopicId: トピックカテゴリの ID。
例
JSON 形式
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"Desc": {
"Type": "String",
"Description": "トピックカテゴリの説明。最大 100 文字の説明を入力できます。", // Description of the topic category. You can enter a description with up to 100 characters.
"MaxLength": 100
},
"IotInstanceId": {
"Type": "String",
"Description": "購入したインスタンス ID。パブリックインスタンスはこのプロパティを渡す必要はありません。" // Instance ID you purchased. Public instances do not need pass this property.
},
"TopicShortName": {
"Type": "String",
"Description": "トピックカテゴリ内のカスタムカテゴリ階層。デフォルトでは、トピックカテゴリには、productKey と ${deviceName} という 2 つのシステム定義のカテゴリ階層が含まれています。スラッシュ (/) を使用してトピック階層を区切ります。トピックカテゴリの形式は productKey/${deviceName}/topicShortName です。\n注: 各カテゴリ階層の名前には、英字、数字、アンダースコア (_) を使用でき、空にすることはできません。" // The custom category hierarchy in the topic category. By default, a topic category contains two system defined category hierarchies: productKey and ${deviceName}. Forward slashes (/) are used to delimit the topic hierarchies. The format of a topic category is productKey/${deviceName}/topicShortName.\nNote The name of each category hierarchy can contain English letters, digits, and underscores (_), and cannot be empty.
},
"Operation": {
"Type": "String",
"Description": "トピックカテゴリに対するデバイスの操作権限。値のオプション:\nSUB: サブスクライブ。デバイスはこのカテゴリのトピックをサブスクライブできます。\nPUB: パブリッシュ。デバイスはこのカテゴリのトピックを使用してメッセージをパブリッシュできます。\nALL: サブスクライブとパブリッシュ。デバイスはこのカテゴリのトピックをサブスクライブし、メッセージをパブリッシュできます。", // Operation permissions of devices on the topic category. Value options:\nSUB: Subscribe. Devices can subscribe to the topics of this category.\nPUB: Publish. Devices can publish messages using the topics of this category.\nALL: Subscribe and publish. Devices can subscribe to and publish messages to the topics of this category.
"AllowedValues": [
"ALL",
"PUB",
"SUB"
]
},
"ProductKey": {
"Type": "String",
"Description": "トピックカテゴリを作成する製品の一意の識別子。" // The unique identifier of the product for which you want to create a topic category.
}
},
"Resources": {
"ProductTopic": {
"Type": "ALIYUN::IOT::ProductTopic",
"Properties": {
"Desc": {
"Ref": "Desc"
},
"IotInstanceId": {
"Ref": "IotInstanceId"
},
"TopicShortName": {
"Ref": "TopicShortName"
},
"Operation": {
"Ref": "Operation"
},
"ProductKey": {
"Ref": "ProductKey"
}
}
}
},
"Outputs": {
"TopicId": {
"Description": "トピック ID", // Topic ID
"Value": {
"Fn::GetAtt": [
"ProductTopic",
"TopicId"
]
}
}
}
}YAML 形式
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
Desc:
Type: String
Description: >-
トピックカテゴリの説明。最大 100 文字の説明を入力できます。 # The description of the topic category. You can enter a description with up to 100 characters.
MaxLength: 100
IotInstanceId:
Type: String
Description: >-
購入したインスタンス ID。パブリックインスタンスはこのプロパティを渡す必要はありません。 # Instance ID you purchased. Public instances do not need pass this property.
TopicShortName:
Type: String
Description: >-
トピックカテゴリ内のカスタムカテゴリ階層。デフォルトでは、トピックカテゴリには productKey と ${deviceName} という 2 つのシステム定義カテゴリ階層が含まれています。スラッシュ (/) を使用してトピック階層を区切ります。トピックカテゴリの形式は productKey/${deviceName}/topicShortName です。
注: 各カテゴリ階層の名前には、英字、数字、およびアンダースコア (_) を使用でき、空にすることはできません。 # The custom category hierarchy in the topic category. By default, a topic category contains two system defined category hierarchies: productKey and ${deviceName}. Forward slashes (/) are used to delimit the topic hierarchies. The format of a topic category is productKey/${deviceName}/topicShortName.
# Note The name of each category hierarchy can contain English letters, digits, and underscores (_), and cannot be empty.
Operation:
Type: String
Description: >-
トピックカテゴリに対するデバイスの操作権限。値のオプション:
SUB: サブスクライブ。デバイスはこのカテゴリのトピックをサブスクライブできます。
PUB: パブリッシュ。デバイスはこのカテゴリのトピックを使用してメッセージをパブリッシュできます。
ALL: サブスクライブとパブリッシュ。デバイスはこのカテゴリのトピックのメッセージをサブスクライブおよびパブリッシュできます。 # Operation permissions of devices on the topic category. Value options:
# SUB: Subscribe. Devices can subscribe to the topics of this category.
# PUB: Publish. Devices can publish messages using the topics of this category.
# ALL: Subscribe and publish. Devices can subscribe to and publish messages to the topics of this category.
AllowedValues:
- ALL
- PUB
- SUB
ProductKey:
Type: String
Description: >-
トピックカテゴリを作成する製品の一意の識別子。 # The unique identifier of the product for which you want to create a topic category.
Resources:
ProductTopic:
Type: 'ALIYUN::IOT::ProductTopic'
Properties:
Desc:
Ref: Desc
IotInstanceId:
Ref: IotInstanceId
TopicShortName:
Ref: TopicShortName
Operation:
Ref: Operation
ProductKey:
Ref: ProductKey
Outputs:
TopicId:
Description: トピック ID # Topic ID
Value:
'Fn::GetAtt':
- ProductTopic
- TopicId