NGSI attributes

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

複数属性の追加

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

プロパティ

  • name: ノード・インスタンスの名前
  • Context Broker: Context Broker のエンドポイント
  • ServicePath: FIWARE Service Path
  • Action type: append
  • Entity id: 追加する属性のエンティティ id
  • Entity type: 追加する属性のエンティティ・タイプ
  • Representation: normalized または keyValues
  • Override 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 Path
  • Action type: update
  • Entity id: 更新する属性のエンティティ id
  • Entity type: 更新する属性のエンティティ・タイプ
  • Representation: normalized または keyValues
  • Override 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 Path
  • Action type: upsert
  • Entity id: アップサートする属性のエンティティ id
  • Entity type: アップサートする属性のエンティティ・タイプ
  • Representation: normalized または keyValues
  • Override 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 Path
  • Action type: replace
  • Entity id: 置換する属性のエンティティ id
  • Entity type: 置換する属性のエンティティ・タイプ
  • Representation: normalized または keyValues
  • Override 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 Path
  • Action type: value of actionType in payload
  • Entity id: 追加、更新、アップサート、または置換する属性のエンティティ id
  • Entity type: 追加、更新、アップサート、または置換する属性のエンティティ・タイプ
  • Representation: normalized または keyValues
  • Override 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