Skip to content

Commit

Permalink
Merge branch 'FRINXio:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
BranislavMalo authored May 28, 2024
2 parents 7ea9f85 + 70a94c0 commit 66ac0f8
Show file tree
Hide file tree
Showing 9 changed files with 285 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,29 @@ Parameters related to installing gNMI nodes with uniconfig-native support:
- Uninstall the device and reinstall it.
- Call `sync-from-network` to sync the data from the device.

!!!
An important install parameter is `gnmi-topology:schema-cache-directory: <folder-name>`. It specifies a folder name in the cache directory with the YANG schemas needed to install a device.
!!!

An important install parameter is `gnmi-topology:schema-cache-directory: <folder-name>`. It specifies a folder name
in the cache directory with the YANG schemas needed to install a device. If this parameter is not specified,
user can create default-capability.json file inside of mentioned cache directory and UniConfig will dynamically
resolve correct cache directory for given node. This json file must have all capabilities that device supports.
Format of default-capability.json:
```json
[
{
"name": "nokia-conf",
"organization": "Nokia",
"version": "22.10.R7"
},
{
"name": "nokia-state",
"organization": "Nokia"
},
{
"name": "nokia-li-state"
}
]
```


### Update paths

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@ notifications.kafka.data-change-events-topic-name=data-change-events
notifications.kafka.connection-notifications-topic-name=connection-notifications
# If only connection notifications for NETCONF stream are enabled.
notifications.kafka.connection-notifications-netconf-stream-only=true
# If only connection notifications for gNMI stream are enabled.
notifications.kafka.connection-notifications-gnmi-stream-only=true
# The maximum thread pool size in the executor.
# A thread pool executor is needed to send messages to Kafka.
notifications.kafka.max-thread-pool-size=8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ This type of notification is generated after each RESTCONF operation.
It contains the following:

- transaction id
- comment
- label
- request data
- uri
- http method
Expand Down Expand Up @@ -143,6 +145,8 @@ calculation difference result.
"http-method": "PUT"
}
},
"label": "user-123",
"comment": "manual tx created by user-123",
"transaction-id": "e0956588-bb94-46a3-a0e0-adecca318dfe",
"response": {
"status-code": 201
Expand Down Expand Up @@ -186,6 +190,7 @@ calculation difference result.
"http-method": "DELETE"
}
},
"label": "user-123",
"transaction-id": "e0956588-bb94-46a3-a0e0-adecca318dfe",
"response": {
"status-code": 204
Expand Down Expand Up @@ -425,6 +430,22 @@ Sample connection notifications captured by Kafka console consumer:
}
```

**gNMI connect notification:**

```json
{
"eventTime": "2022-02-17T10:09:51.41777-00:00",
"nodeId": "UC-5b4d0cec-6493-4e3d-bd1c-348a3ce83600",
"streamName": "CONNECTION",
"identifier": "connection-notification",
"body": {
"node-id": "R3",
"topology": "gnmi-topology",
"connection-status": "connecting",
"connection-message": "connecting"
}
}
```
## Database entities

The following **three tables** in the database are related to notifications:
Expand Down Expand Up @@ -1025,6 +1046,8 @@ notifications.kafka.data-change-events-topic-name=data-change-events
notifications.kafka.connection-notifications-topic-name=connection-notifications
# If only connection notifications for NETCONF stream are enabled.
notifications.kafka.connection-notifications-netconf-stream-only=true
# If only connection notifications for gNMI stream are enabled.
notifications.kafka.connection-notifications-gnmi-stream-only=true
# The maximum thread pool size in the executor.
# A thread pool executor is needed to send messages to Kafka.
notifications.kafka.max-thread-pool-size=8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ See below for additional information on individual RPCs:
- [RPC commit](../uniconfig-node-manager/rpc_commit)
- [RPC compare-config](../uniconfig-node-manager/rpc_compare-config)
- [RPC get-installed-nodes](../uniconfig-node-manager/uniconfig_get_installed_devices)
- [RPC check-nodes-connection](../uniconfig-node-manager/uniconfig_check_nodes_connection)
- [RPC health](../uniconfig-node-manager/rpc_health)
- [RPC install-multiple-nodes](../uniconfig-node-manager/uniconfig_install_multiple_nodes)
- [RPC is-in-sync](../uniconfig-node-manager/rpc_is-in-sync)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ The configuration of nodes consists of the following phases:
6. **Rollback**: Restore the configuration to its previous state if the
configuration process fails. When configuring multiple devices in a single
transaction and the process fails on one particular device, the rollback
procedure is applied to all touched devices. This is done with the auto
procedure is applied to **all touched devices**. This is done with the auto
rollback procedure, which is by enabled by default. The procedure can be
disabled with the `do-rollback` flag in the RPC input, in which case only
failed devices are rolled back.
disabled with the `do-rollback` flag in the RPC input, in which case **only
failed devices are rolled back**.

!!!
The `skip-unreachable-nodes` flag controls whether unreachable nodes are
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# RPC connect-node

This RPC is similar to the **mount-node RPC** in that it creates a connection to
a device that is already installed. The connection is created outside of a
transaction, so that the connection stays up even without active transactions.
This RPC creates a connection to a device that is already installed.
The connection is created outside of a transaction,
so that the connection stays up even without active transactions.

!!!
Note that the transaction used in this RPC is created internally, so that no
Expand All @@ -20,8 +20,9 @@ The **connect-node RPC** only works on local Uniconfig nodes in a cluster.

## RPC parameters

- `node-id` (mandatory) - ID of stream node. Consists of a device node and
stream name (`<device node>_<stream name>`, for example `R1_NETCONF`).
- `node-id` (mandatory) - ID of a node. In case of a stream node, the node
consists of a device node and a stream name (`<device node>_<stream name>`,
for example `R1_NETCONF`).
- `max-connection-attempts` - Maximum number of connection attempts. The default
value is 1.
- `between-attempts-timeout` - Timeout between connection attempts in seconds.
Expand All @@ -32,8 +33,7 @@ The **connect-node RPC** only works on local Uniconfig nodes in a cluster.
The **connect-node RPC** is also included in
[UniConfig shell](https://docs.frinx.io/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/).
As it takes `node-id` as input, the shell only suggests nodes that are relevant
to this RPC (for example, nodes that are installed in UniConfig but are not yet
connected).
to this RPC (nodes that are installed in UniConfig but are not yet connected).

## RPC examples

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# RPC disconnect-node

This RPC is similar to the **unmount-node RPC** in that it closes a connection
to a device.
This RPC closes connection to a device. If a node is associated with multiple
transactions, it will be removed from all of them.

!!!
Note that the transaction used in this RPC is created internally, so that no
Expand All @@ -10,20 +10,23 @@ user-created transactions are used.

The **disconnect-node RPC** also supports disconnecting stream nodes.

!!! Note that the **disconnect-node RPC** only works on local Uniconfig nodes in
a cluster. !!!
!!!
Note that the **disconnect-node RPC** only works on local Uniconfig nodes in
a cluster.
!!!

## RPC parameters

- `node-id` (mandatory) - ID of stream node. Consists of a device node and
stream name (`<device node>_<stream name>`, for example `R1_NETCONF`).
- `node-id` (mandatory) - ID of a node. In case of a stream node, the node
consists of a device node and a stream name (`<device node>_<stream name>`,
for example `R1_NETCONF`).

## UniConfig shell

The **disconnect-node RPC** is also included in
[UniConfig shell](https://docs.frinx.io/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/).
As it takes `node-id` as input, the shell only suggests nodes user that are
relevant to this RPC (for example, connected nodes).
As it takes `node-id` as input, the shell only suggests nodes that are relevant
to this RPC (nodes that are already connected).

## RPC examples

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
# RPC check-nodes-connection

This RPC checks if specified devices are reachable (health-check). This is done by session creation,
single request execution (most lightweight one), session cleanup.

RPC input specifies target-nodes on which UniConfig checks connection. Each target-node is executed in parallel and
whole RPC is outside the uniconfig transaction concept. Output describes only failed health-check operations.
Input may also contain `connection-timeout` which is overall timeout for operation -> establishing session amd single request to device.
This timeout is applied individually per each target-node (default value is 5 seconds).


## RPC examples

### Successful example

RPC input specify a device R1 without specifying connection-timeout parameter.

```bash RPC Request
curl --location --request POST 'http://localhost:8181/rests/operations/connection-manager:check-nodes-connection' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": {
"target-nodes" : {
"node" : ["R1"]
}
}
}'
```

```json RPC Response, Status: 204
```

### Failed example

RPC input specifies device R1 (reachable), R2 (not reachable).
Input also contains `connection-timeout` parameter set for 3 seconds.
Operation was successful only for device R1. Output describes output for failed device R2.

```bash RPC Request
curl --location --request POST 'http://localhost:8181/rests/operations/connection-manager:check-nodes-connection' \
--header 'Authorization: Basic YWRtaW46YWRtaW4=' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": {
"target-nodes" : {
"node" : ["R1", "R2"]
},
"connection-timeout": 3
}
}'
```

```json RPC Response, Status: 500
{
"errors": {
"error": [
{
"error-tag": "operation-failed",
"error-info": {
"node-id": "R2",
"error": "Health-check operation on node R2 timed out after 3 seconds",
"topology-id": "gnmi-topology"
},
"error-message": "Could not invoke health-check operation for node 'R2' and topology 'gnmi-topology'",
"error-type": "application"
}
]
}
}
```

### Failed example

RPC input specifies device R1 which is not installed.

```bash RPC Request
curl --location --request POST 'http://localhost:8181/rests/operations/connection-manager:check-nodes-connection' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"input": {
"target-nodes" : {
"node" : ["R1"]
}
}
}'
```

```json RPC Response, Status: 404
{
"errors": {
"error": [
{
"error-tag": "data-missing",
"error-info": {
"node-id": "R1"
},
"error-message": "Node with ID 'R1' is not installed",
"error-type": "application"
}
]
}
}
```
Loading

0 comments on commit 66ac0f8

Please sign in to comment.