Skip to content

Commit

Permalink
Merge 0b6d8ca into ea20b42
Browse files Browse the repository at this point in the history
  • Loading branch information
fisuda committed Feb 10, 2023
2 parents ea20b42 + 0b6d8ca commit 3633711
Show file tree
Hide file tree
Showing 11 changed files with 2,035 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## node-red-contrib-letsfiware-NGSI v0.7.1-next

- ADD NGSI attributes custom node (#58)
- FIX node name (#56)
- ADD NGSI attribute value custom node (#55)
- ADD NGSI entity CRUD custom node (#53)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Node-RED implementation for FIWARE Open APIs
- [NGSI Entity](docs/custom_nodes/ngsi_entity.md)
- [NGSI Entity CRUD](docs/custom_nodes/ngsi_entity_crud.md)
- [NGSI Source](docs/custom_nodes/ngsi_source.md)
- [NGSI Attributes](docs/custom_nodes/ngsi_attributes.md)
- [NGSI Attribute value](docs/custom_nodes/ngsi_attribute_value.md)
- [NGSI Batch update](docs/custom_nodes/ngsi_batch_update.md)
- [NGSI Subscription](docs/custom_nodes/ngsi_subscription.md)
Expand Down
336 changes: 336 additions & 0 deletions docs/custom_nodes/ngsi_attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,336 @@
# NGSI attributes

This custom node is a simple node that allows to append, update, upsert or replace attributes of NGSIv2 entity.

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

## Append attributes

It alows to append attributes of NGSIv2 entity.

### Properties

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

- `name`: a name for a node instance
- `Context Broker`: an endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: append
- `Entity id`: Entity id to retrieve an attributes
- `Entity type`: Entity type to retrieve an attributes
- `Representation`: normalized or keyValues
- `Override metadata`: If true, replace the existing metadata
- `Forced update`: If true, it triggers matching subscriptions
- `Flow control`: If true, it enables flow control mechanism

### Exmaple

#### Input

Payload *JSON Object*

A `msg.payload` should contain an object with the attributes.

```
{
"temperature": {
"type": "Number",
"value": 17,
"metadata": {}
}
}
```

#### Output

Payload *null or string*

A `msg.payload` contains a status code.

```
204
```

```
null
```

## Update attributes

It alows to update attributes of NGSIv2 entity.

### Properties

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

- `name`: a name for a node instance
- `Context Broker`: an endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: update
- `Entity id`: Entity id to retrieve an attributes
- `Entity type`: Entity type to retrieve an attributes
- `Representation`: normalized or keyValues
- `Override metadata`: If true, replace the existing metadata
- `Forced update`: If true, it triggers matching subscriptions
- `Flow control`: If true, it enables flow control mechanism

### Exmaple

#### Input

Payload *JSON Object*

A `msg.payload` should contain an object with the attributes.

```
{
"temperature": {
"type": "Number",
"value": 20,
"metadata": {}
}
}
```

#### Output

Payload *null or string*

A `msg.payload` contains a status code.

```
204
```

```
null
```

## Upsert attributes

It alows to upsert attributes of NGSIv2 entity.

### Properties

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

- `name`: a name for a node instance
- `Context Broker`: an endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: upsert
- `Entity id`: Entity id to retrieve an attributes
- `Entity type`: Entity type to retrieve an attributes
- `Representation`: normalized or keyValues
- `Override metadata`: If true, replace the existing metadata
- `Forced update`: If true, it triggers matching subscriptions
- `Flow control`: If true, it enables flow control mechanism

### Exmaple

#### Input

Payload *JSON Object*

A `msg.payload` should contain an object with the attributes.

```
{
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"humidity": {
"type": "Number",
"value": 42.9,
"metadata": {}
}
}
```

#### Output

Payload *null or string*

A `msg.payload` contains a status code.

```
204
```

```
null
```

## Replace attributes

It alows to replace attributes of NGSIv2 entity.

### Properties

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

- `name`: a name for a node instance
- `Context Broker`: an endpoint of a context broker
- `ServicePath`: FIWARE Service Path
- `Action type`: replace
- `Entity id`: Entity id to retrieve an attributes
- `Entity type`: Entity type to retrieve an attributes
- `Representation`: normalized or keyValues
- `Override metadata`: If true, replace the existing metadata
- `Forced update`: If true, it triggers matching subscriptions
- `Flow control`: If true, it enables flow control mechanism

### Exmaple

#### Input

Payload *JSON Object*

A `msg.payload` should contain an object with the attributes.

```
{
"temperature": {
"type": "Number",
"value": 25,
"metadata": {}
},
"relativeHumidity": {
"type": "Number",
"value": 45,
"metadata": {}
},
"atmosphericPressure": {
"type": "Number",
"value": 1003.5,
"metadata": {}
}
}
```

#### Output

Payload *null or string*

A `msg.payload` contains a status code.

```
204
```

```
null
```

## Use value of actionType in payload

It alows to append, update, upsert or replace attributes of NGSIv2 entity.

### Properties

![](https://raw.githubusercontent.com/lets-fiware/node-red-contrib-letsfiware-NGSI/gh-pages/images/attributes-06.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
- `Entity id`: Entity id to retrieve an attributes
- `Entity type`: Entity type to retrieve an attributes
- `Representation`: normalized or keyValues
- `Override metadata`: If true, replace the existing metadata
- `Forced update`: If true, it triggers matching subscriptions
- `Flow control`: If true, it enables flow control mechanism

### Exmaple

#### Input

Payload *JSON Object*

A `msg.payload` should contain a JSON Object with actionType and an object with the attributes.

```
{
"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": {}
}
}
}
```

#### Output

Payload *null or string*

A `msg.payload` contains a status code.

```
204
```

```
null
```
1 change: 1 addition & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Node-RED NGSI integration
- [NGSI Entity](custom_nodes/ngsi_entity.md)
- [NGSI Entity CRUD](custom_nodes/ngsi_entity_crud.md)
- [NGSI Source](custom_nodes/ngsi_source.md)
- [NGSI Attributes](custom_nodes/ngsi_attributes.md)
- [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)
Expand Down

0 comments on commit 3633711

Please sign in to comment.