NGSI attributes
このカスタム・ノードは、NGSIv2 エンティティの複数属性を追加、更新、アップサート、または置換できるノードです。

複数属性の追加
NGSIv2 エンティティの複数属性を追加できます。
プロパティ

name: ノード・インスタンスの名前Context Broker: Context Broker のエンドポイントServicePath: FIWARE Service PathAction type:appendEntity id: 追加する属性のエンティティ idEntity type: 追加する属性のエンティティ・タイプRepresentation:normalizedまたはkeyValuesOverride metadata: true の場合、既存のメタデータを置き換えますForced update: true の場合、一致するサブスクリプションをトリガーしますFlow control: true の場合、フロー制御メカニズムが有効になりますEncode forbidden chars:offまたはon
入力
payload JSON Object
msg.payload には、属性のオブジェクトが含まれている必要があります。
{
"temperature": {
"type": "Number",
"value": 17,
"metadata": {}
}
}
出力
statusCode Number
msg.statusCode にはステータス・コードが含まれています。
204
複数属性の更新
NGSIv2 エンティティの複数属性を更新できます。
プロパティ

name: ノード・インスタンスの名前Context Broker: Context Broker のエンドポイントServicePath: FIWARE Service PathAction type:updateEntity id: 更新する属性のエンティティ idEntity type: 更新する属性のエンティティ・タイプRepresentation:normalizedまたはkeyValuesOverride metadata: true の場合、既存のメタデータを置き換えますForced update: true の場合、一致するサブスクリプションをトリガーしますFlow control: true の場合、フロー制御メカニズムが有効になりますEncode forbidden chars:offまたはon
入力
payload JSON Object
msg.payload には、属性のオブジェクトが含まれている必要があります。
{
"temperature": {
"type": "Number",
"value": 20,
"metadata": {}
}
}
出力
statusCode Number
msg.statusCode にはステータス・コードが含まれています。
204
複数属性のアップサート
NGSIv2 エンティティの複数属性をアップサートできます。
プロパティ

name: ノード・インスタンスの名前Context Broker: Context Broker のエンドポイントServicePath: FIWARE Service PathAction type:upsertEntity id: アップサートする属性のエンティティ idEntity type: アップサートする属性のエンティティ・タイプRepresentation:normalizedまたはkeyValuesOverride metadata: true の場合、既存のメタデータを置き換えますForced update: true の場合、一致するサブスクリプションをトリガーしますFlow control: true の場合、フロー制御メカニズムが有効になりますEncode forbidden chars:offまたはon
入力
payload JSON Object
msg.payload には、属性のオブジェクトが含まれている必要があります。
{
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"humidity": {
"type": "Number",
"value": 42.9,
"metadata": {}
}
}
出力
statusCode Number
msg.statusCode にはステータス・コードが含まれています。
204
複数属性の置換
NGSIv2 エンティティの複数属性を置換できます。
プロパティ

name: ノード・インスタンスの名前Context Broker: Context Broker のエンドポイントServicePath: FIWARE Service PathAction type:replaceEntity id: 置換する属性のエンティティ idEntity type: 置換する属性のエンティティ・タイプRepresentation:normalizedまたはkeyValuesOverride metadata: true の場合、既存のメタデータを置き換えますForced update: true の場合、一致するサブスクリプションをトリガーしますFlow control: true の場合、フロー制御メカニズムが有効になりますEncode forbidden chars:offまたはon
入力
payload JSON Object
msg.payload には、属性のオブジェクトが含まれている必要があります。
{
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
出力
statusCode Number
msg.statusCode にはステータス・コードが含まれています。
204
Payload 内の actionType の値を使用
NGSIv2 エンティティの複数属性を追加、更新、アップサート、または置換できます。
プロパティ

name: ノード・インスタンスの名前Context Broker: Context Broker のエンドポイントServicePath: FIWARE Service PathAction type:value of actionType in payloadEntity id: 追加、更新、アップサート、または置換する属性のエンティティ idEntity type: 追加、更新、アップサート、または置換する属性のエンティティ・タイプRepresentation:normalizedまたはkeyValuesOverride metadata: true の場合、既存のメタデータを置き換えますForced update: true の場合、一致するサブスクリプションをトリガーしますFlow control: true の場合、フロー制御メカニズムが有効になりますEncode forbidden chars:offまたはon
入力
payload JSON Object
msg.payload には、actionType と複数属性のオブジェクトを持つ JSON Object が含まれている必要があります。
{
"actionType": "append",
"id": "E2",
"attributes": {
"temperature": {
"type": "Number",
"value": 17,
"metadata": {}
}
}
}
{
"actionType": "update",
"id": "E2",
"attributes": {
"temperature": {
"type": "Number",
"value": 20,
"metadata": {}
}
}
}
{
"actionType": "upsert",
"id": "E2",
"attributes": {
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"humidity": {
"type": "Number",
"value": 42.9,
"metadata": {}
}
}
}
{
"actionType": "replace",
"id": "E2",
"attributes": {
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
}
出力
statusCode Number
msg.statusCode にはステータス・コードが含まれています。
204