Skip to content

Commit

Permalink
ADD NGSI registration custom node
Browse files Browse the repository at this point in the history
  • Loading branch information
fisuda committed Feb 16, 2023
1 parent 88f8e95 commit 7e6ac96
Show file tree
Hide file tree
Showing 13 changed files with 1,717 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,5 +1,6 @@
## node-red-contrib-letsfiware-NGSI v0.8.0-next

- ADD NGSI registration custom node (#82)
- ADD NGSI types custom node (#80)
- UPDATE Node.js dependencies (#78)
- ADD Japanese translation (#77)
Expand Down
1 change: 1 addition & 0 deletions README.ja.md
Expand Up @@ -24,6 +24,7 @@ FIWARE Open APIs の Node-RED 実装
- [NGSI Attribute value](docs/ja/custom_nodes/ngsi_attribute_value.md)
- [NGSI Batch update](docs/ja/custom_nodes/ngsi_batch_update.md)
- [NGSI Subscription](docs/ja/custom_nodes/ngsi_subscription.md)
- [NGSI Registration](docs/en/custom_nodes/ngsi_registration.md)
- [NGSI Types](docs/ja/custom_nodes/ngsi_types.md)
- [Historical context](docs/ja/custom_nodes/historical_context.md)
- [NGSI to Worldmap](docs/ja/custom_nodes/ngsi_to_worldmap.md)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -26,6 +26,7 @@ Node-RED implementation for FIWARE Open APIs
- [NGSI Attribute value](docs/en/custom_nodes/ngsi_attribute_value.md)
- [NGSI Batch update](docs/en/custom_nodes/ngsi_batch_update.md)
- [NGSI Subscription](docs/en/custom_nodes/ngsi_subscription.md)
- [NGSI Registration](docs/en/custom_nodes/ngsi_registration.md)
- [NGSI Types](docs/en/custom_nodes/ngsi_types.md)
- [Historical context](docs/en/custom_nodes/historical_context.md)
- [NGSI to Worldmap](docs/en/custom_nodes/ngsi_to_worldmap.md)
Expand Down
167 changes: 167 additions & 0 deletions docs/en/custom_nodes/ngsi_registration.md
@@ -0,0 +1,167 @@
# NGSI Registration

This custom node is a simple node that allows to create or delete an NGSIv2 registration.

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-01.png)

<details>
<summary><strong>Details</strong></summary>

- [Create a registration](#create-a-registration)
- [Delete a registration](#delete-a-registration)
- [Use value of actionType in payload](#use-value-of-actiontype-in-payload)

</details>

## Create a registration

This operation allows to create a new registration.

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-02.png)

- `name`: A name for a node instance
- `Context Broker`: An endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: `create`

### Examples

#### Input

Payload *JSON Object*

A `msg.payload` contains a NGSIv2 registration data.

```json
{
"description": "Relative Humidity Context Source",
"dataProvided": {
"entities": [
{
"id": "room",
"type": "Room"
}
],
"attrs": [
"relativeHumidity"
]
},
"provider": {
"http": {
"url": "http://orion:1026"
}
}
}
```

#### Output

Payload *string*

A `msg.payload` contains a registration id.

```text
63ed51173bdeaadaf909c57b
```

## Delete a registration

This operation allows to delete a existing registration.

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-03.png)

- `name`: A name for a node instance
- `Context Broker`: An endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: `delete`

### Example

#### Input

Payload *string*

A `msg.payload` contains a registration id.

```
63ed51173bdeaadaf909c57b
```

#### Output

Payload *Number* or *null*

A `msg.payload` contains a status code.

```
204
```

```
null
```

## Use value of actionType in payload

This operation allows to create or delete a registration.

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-04.png)

- `name`: A name for a node instance
- `Context Broker`: An endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: `value of actionType in payload`

### Example

When creating a new registration, A `msg.payload` should contain a JSON Object with actionType and registration data.

#### Input

```json
{
"actionType": "delete",
"id": "63ed53123bdeaadaf909c57d"
}
```

#### Output

Payload *string*

A `msg.payload` contains a registration id.

```text
63ed51173bdeaadaf909c57b
```

When deleting a existing registration, A `msg.payload` should contain a JSON Object with actionType and registration id.

#### Input

```json
{
"actionType": "delete",
"id": "63ea11e4a0cec98fc6017aae"
}
```

#### Output

Payload *Number* or *null*

A `msg.payload` contains a status code.

```
204
```

```
null
```
1 change: 1 addition & 0 deletions docs/en/index.md
Expand Up @@ -16,6 +16,7 @@ Node-RED NGSI integration
- [NGSI Attribute value](custom_nodes/ngsi_attribute_value.md)
- [NGSI Batch update](custom_nodes/ngsi_batch_update.md)
- [NGSI Subscription](custom_nodes/ngsi_subscription.md)
- [NGSI Registration](custom_nodes/ngsi_registration.md)
- [NGSI Types](custom_nodes/ngsi_types.md)
- [Historical context](custom_nodes/historical_context.md)
- [NGSI to Worldmap](custom_nodes/ngsi_to_worldmap.md)
Expand Down
175 changes: 175 additions & 0 deletions docs/ja/custom_nodes/ngsi_registration.md
@@ -0,0 +1,175 @@
# NGSI Registration

このカスタム・ノードは、NGSIv2 レジストレーションを作成または削除できるノードです。

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-01.png)

## コンテンツ

<details>
<summary><strong>詳細</strong></summary>

- [レジストレーションの作成](#create-a-registration)
- [レジストレーションの削除](#delete-a-registration)
- [Payload 内の actionType の値を使用](#use-value-of-actiontype-in-payload)

</details>

<a name="create-a-registration"></a>

## レジストレーションの作成

新しい登録を作成できます。

### プロパティ

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-02.png)

- `name`: ノード・インスタンスの名前
- `Context Broker`: Context Broker のエンドポイント
- `ServicePath`: FIWARE Service Path
- `Action type`: `create`

###

#### 入力

Payload *JSON Object*

`msg.payload`には、NGSIv2 レジストレーション・データを含める必要があります。

```json
{
"description": "Relative Humidity Context Source",
"dataProvided": {
"entities": [
{
"id": "room",
"type": "Room"
}
],
"attrs": [
"relativeHumidity"
]
},
"provider": {
"http": {
"url": "http://orion:1026"
}
}
}
```

#### 出力

Payload *string*

`msg.payload` には、レジストレーション id が含まれます。

```text
63ed51173bdeaadaf909c57b
```

<a name="delete-a-registration"></a>

## レジストレーションの削除

既存のレジストレーションを更新できます。

### プロパティ

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-03.png)

- `name`: ノード・インスタンスの名前
- `Context Broker`: Context Broker のエンドポイント
- `ServicePath`: FIWARE Service Path
- `Action type`: `delete`

###

#### 入力

Payload *string*

msg.payload` には、レジストレーション id を含める必要があります。

```
63ed51173bdeaadaf909c57b
```

#### 出力

Payload *Number* or *null*

`msg.payload` にはステータス・コードが含まれています。

```
204
```

```
null
```

<a name="use-value-of-actiontype-in-payload"></a>

## Payload 内の actionType の値を使用

レジストレーションを作成、または削除できます。

### プロパティ

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/registration/registration-04.png)

- `name`: ノード・インスタンスの名前
- `Context Broker`: Context Broker のエンドポイント
- `ServicePath`: FIWARE Service Path
- `Action type`: `value of actionType in payload`

###

新しいレジストレーションを作成する場合、`msg.payload` には、actionType とレジストレーション・データを含む JSON オブジェクトが含まれている必要があります。

#### 入力

```json
{
"actionType": "delete",
"id": "63ed53123bdeaadaf909c57d"
}
```

#### 出力

Payload *string*

`msg.payload` には、レジストレーション id が含まれます。

```text
63ed51173bdeaadaf909c57b
```

既存の登録を削除する場合、`msg.payload` には、actionType とレジストレーション id を持つ JSON オブジェクトが含まれている必要があります。

#### 入力

```json
{
"actionType": "delete",
"id": "63ea11e4a0cec98fc6017aae"
}
```

#### 出力

Payload *Number* or *null*

`msg.payload` にはステータス・コードが含まれています。

```
204
```

```
null
```
1 change: 1 addition & 0 deletions docs/ja/index.md
Expand Up @@ -16,6 +16,7 @@ FIWARE Open APIs の Node-RED 実装
- [NGSI Attribute value](custom_nodes/ngsi_attribute_value.md)
- [NGSI Batch update](custom_nodes/ngsi_batch_update.md)
- [NGSI Subscription](custom_nodes/ngsi_subscription.md)
- [NGSI Registration](custom_nodes/ngsi_registration.md)
- [NGSI Types](custom_nodes/ngsi_types.md)
- [Historical context](custom_nodes/historical_context.md)
- [NGSI to Worldmap](custom_nodes/ngsi_to_worldmap.md)
Expand Down

0 comments on commit 7e6ac96

Please sign in to comment.