Skip to content

Commit

Permalink
Merge pull request #244 from MatejGlemba/device_type_gnmi
Browse files Browse the repository at this point in the history
Update device-type gnmi parameter docs
  • Loading branch information
puskarpeter authored Jul 18, 2024
2 parents 00eb9c0 + 29bffec commit 1479e08
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ Basic connection parameters used to identify a remote device:
- `node-id` - Name of the node that represents the device/mountpoint in the topology.
- `gnmi-topology:host` - IP address or domain name of the target device running the gNMI server.
- `gnmi-topology:port` - TCP port where the gNMI server is listening to incoming connections.
- `gnmi-topology:device-type` - Specific device type. For now, only the `sonic` device type is supported. This parameter is used to create a device-type specific gNOI session. By default, this parameter is not specified.
- `gnmi-topology:device-type` - Specific device type, which enables some device-specific behavior. By default, this parameter is not specified.
- `gnmi-topology:connection-type` - If specified, an insecure connection is created. The insecure connection is available only for DEBUG reasons. To establish a gRPC connection without TLS, choose the insecure connection type `PLAINTEXT`. The connection type `PLAINTEXT` indicates that the target should skip the signature verification steps if a secure connection is used.
- `gnmi-topology:keystore-id` - If specified, a secure connection is created. Also requires `keystore-id` (identifier of the keystore), which is defined in the `gnmi-certificate-storage` model.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# IosXR 7 device

## Install device

A IosXR7 device can be installed through gNMI with the following request:

```bash
curl --location 'http://localhost:8181/rests/operations/connection-manager:install-node' \
--header 'Content-Type: application/json' \
--data '{
"input": {
"node-id": "iosxr7",
"gnmi": {
"schema-cache-directory": "{cache-directory}",
"uniconfig-config:whitelist": {
"path": [
"Cisco-IOS-XR-ifmgr-cfg:interface-configurations",
"openconfig-interfaces:interfaces"
]
},
"uniconfig-config:uniconfig-native-enabled": true,
"uniconfig-config:sequence-read-active": true,
"connection-parameters": {
"host": "127.0.0.1",
"port": 57400,
"connection-type": "INSECURE",
"device-type": "iosxr7",
"credentials": {
"username": "admin",
"password": "admin"
}
},
"session-timers": {
"request-timeout": 100
},
"extensions-parameters": {
"gnmi-parameters": {
"use-model-name-prefix": true
},
"force-cached-capabilities": [
null
]
}
}
}
}'
```

## Uninstall device

To uninstall a device:

```bash
curl --location 'http://localhost:8181/rests/operations/connection-manager:uninstall-node' \
--header 'Content-Type: application/json' \
--data '{
"input": {
"node-id": "iosxr7",
"connection-type": "gnmi"
}
}'
```
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ curl --location 'http://localhost:8181/rests/operations/connection-manager:insta
"connection-parameters": {
"host": "127.0.0.1",
"port": 57400,
"device-type": "nokia",
"connection-type": "PLAINTEXT",
"credentials": {
"username": "<username>",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,11 @@ To create subscriptions, the following are required in **application.properties*
- `notifications.kafka.gnmi-notifications-topic-name=gnmi-notifications`
- `notifications.kafka.embedded-kafka.enabled=true` (or its own Kafka, in which case kafka-servers needs to be adjusted)

The install request must specify the parameters necessary to create a subscription for a specific device. Mandatory fields are `stream-name` (a marker for the particular subscription) and `paths` (a list of paths to which the gNMI souhtbound plugin will be subscribed, with at least one path). Non-mandatory fields specify a time range of the subscription. Both `start-time` and `stop-time` are in [RFC339 format](https://datatracker.ietf.org/doc/html/rfc3339).
The install request must specify the parameters necessary to create a subscription for a specific device.
Mandatory fields are `stream-name` (a marker for the particular subscription) and `paths`
(a list of paths to which the gNMI souhtbound plugin will be subscribed, with at least one path).
Non-mandatory fields specify a time range of the subscription or subscription mode. Both `start-time` and `stop-time` are in [RFC3339 format](https://datatracker.ietf.org/doc/html/rfc3339).
Subscription mode can be SAMPLE, ON_CHANGE or TARGET_DEFINED

```json stream inside of install-node RPC request
{
Expand All @@ -141,7 +145,8 @@ The install request must specify the parameters necessary to create a subscripti
"stream-name": "GNMI_lldp",
"paths": [
"openconfig-lldp:lldp"
]
],
"mode": "SAMPLE"
}
]
}
Expand All @@ -150,7 +155,7 @@ The install request must specify the parameters necessary to create a subscripti

Subscriptions are created independently from node installation. The result of the install-node RPC relates only to node installation, and that RPC will only invoke the telemetry stream subscription process.

Subscriptions are created in the gNMI southbound plugin using the Subscribe RPC from the gNMI service defined in the proto3 file. The gNMI southbound plugin can subscribe to wildcarded paths as well as multiple paths at once. It only supports the `STREAM` subscription mode and `ON_CHANGE` stream mode.
Subscriptions are created in the gNMI southbound plugin using the Subscribe RPC from the gNMI service defined in the proto3 file. The gNMI southbound plugin can subscribe to wildcarded paths as well as multiple paths at once. It supports only the `STREAM` subscription mode with `SAMPLE`, `ON_CHANGE` and `TARGET_DEFINED` stream mode.

If a time range is specified, it is part of the Subscribe request. If the device does not support time ranges on its server side, the gNMI southbound plugin can handle them. Note that if the timestamp of the received message is outside of the specified time range, the message is not saved to the database or published to the Kafka topic.

Expand All @@ -174,3 +179,4 @@ The tool is used for scale-testing purposes to simulate the interactions of thou
Examples:
- [!ref](sonic.md)
- [!ref](nokia.md)
- [!ref](iosxr7.md)

0 comments on commit 1479e08

Please sign in to comment.