Skip to content

Commit 1236b03

Browse files
committed
Add gateway node docu Co-authored-by: Jitpanu Maneeratpongsuk <jitpanu.maneeratpongsuk@rwth-aachen.de>
Signed-off-by: Alexandra <alexandra.bach@eonerc.rwth-aachen.de>
1 parent c2cbc19 commit 1236b03

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

docs/node/nodes/gateway.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ hide_table_of_contents: true
55

66
# Gateway
77

8-
The `gateway` node-type enable VILLASnode to transform api type.
8+
The `gateway` node-type enables VILLASnode to transform Application Programmable Interfaces (API) types.
99
Currently, the transformation of [http](https://en.wikipedia.org/wiki/HTTP) and [gRPC](https://grpc.io/) is supported.
1010

1111

1212
### Limitations
1313

1414
- For protobuf payload that is not [VILLASnode format](../formats/protobuf.md), only simple datatypes are supported.
15-
- It only supported unary RPC.
15+
- It only supportes unary RPC.
1616

1717

1818
## Prerequisites
@@ -55,17 +55,20 @@ nodes = {
5555
## Usage
5656

5757
The usage of this node is similar to [`api`](api.md) node-type.
58-
The following [`curl`](https://curl.se/) commands are example for calling gRPC method with HTTP api.
59-
The input of gRPC method can be either by the body of http request or input data from other node(via a [path](../config/paths.md)).
58+
The following [`curl`](https://curl.se/) commands are examples for calling gRPC methods with http API.
59+
The input for a gRPC call can be either the body of http request or input data from another node (via a [path](../config/paths.md)).
6060
If the http request body is empty, the input from other node will be used.
6161

62+
Since this node-type does not implement the gRPC server, it needs to be added manually. A description is available [here](https://www.acs.eonerc.rwth-aachen.de/global/show_document.asp?id=aaaaaaaadidaesd).
63+
6264
Note on http methods
6365
- GET should be used only when the input of gRPC method can be empty or ignored.
6466
- PUT should be used when the output of gRPC method is in VILLASnode format and the user want to put the data to the path.
6567
- POST should be used when the output of gRPC method is not in VILLASnode format or the user not want output data to the path.
6668

6769

68-
#### The url for sending a request to this node-type are as following
70+
### General Request
71+
The url for sending a request to the gateway node-type is as following:
6972
```
7073
http://<address>:<port>/api/v2/gateway/<node name or UUID>/<gRPC package>/<gRPC service>/<gRPC method>
7174
```
@@ -94,23 +97,23 @@ message msg {
9497
9598
```
9699

97-
#### Call GetData method on gRPC server
100+
### Call GetData method on gRPC server
98101

99102
```shell
100103
curl http://localhost:8080/api/v2/gateway/gateway_node/ex_server/ex_service/GetData -XPUT
101104
```
102105
Since the PUT method is used, the output from gRPC method will be put to the path.
103106

104-
#### Call SetData method on gRPC server
107+
### Call SetData method on gRPC server
105108

106109
```shell
107110
curl http://localhost:8080/api/v2/gateway/gateway_node/ex_server/ex_service/SetData -XPOST
108111
```
109112
Since the body is empty the data from the path will be send to gRPC server.
110113

111-
#### Call GetDataRef method on gRPC server
114+
### Call GetDataRef method on gRPC server
112115

113116
```shell
114117
curl http://localhost:8080/api/v2/gateway/gateway_node/ex_server/ex_service/GetDataRef -d '{"ref":[0,1,2,3,4]}'
115118
```
116-
Since the body is not empty, it will be form into protobuf payload based on the example `.proto` file and send to the gRPC server.
119+
Since the body is not empty, it will a protobuf payload based on the example `.proto` file and send to the gRPC server.

docs/node/nodes/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ VILLASnode currently supports the following node-types:
2727
| [exec](exec.md) | no | yes | yes | unlimited | stable | |
2828
| [file](file.md) | no | yes | yes | unlimited | stable | |
2929
| [fpga](fpga.md) | no | yes | yes | ? | beta | |
30+
| [gateway](gateway.md) | no | yes | yes | unlimited | stable | HTTP to gRPC conversion only |
3031
| [iec60870-5-104](iec60870-5-104.md) | no | no | yes | 1 | stable | |
3132
| [iec61850-8-1](iec61850-8-1.md) | no | yes | yes | 1 | alpha | |
3233
| [iec61850-9-2](iec61850-9-2.md) | no | yes | yes | 1 | beta | |

0 commit comments

Comments
 (0)