From 9612beda495936719cb27bc497b390f9e0e3cdf3 Mon Sep 17 00:00:00 2001 From: Matej Glemba Date: Thu, 18 Jul 2024 13:03:15 +0200 Subject: [PATCH 1/2] Update device-type gnmi parameter docs Signed-off-by: Matej Glemba --- .../uniconfig-installing/readme.md | 2 +- .../uniconfig_gnmi/iosxr7.md | 62 +++++++++++++++++++ .../uniconfig_gnmi/nokia.md | 1 + .../uniconfig_gnmi/readme.md | 12 +++- 4 files changed, 73 insertions(+), 4 deletions(-) create mode 100644 frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/iosxr7.md diff --git a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig-installing/readme.md b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig-installing/readme.md index 73d1054e1..f785af2ee 100644 --- a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig-installing/readme.md +++ b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig-installing/readme.md @@ -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. diff --git a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/iosxr7.md b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/iosxr7.md new file mode 100644 index 000000000..2296578a8 --- /dev/null +++ b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/iosxr7.md @@ -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" + } +}' +``` \ No newline at end of file diff --git a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/nokia.md b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/nokia.md index 5ef2d5d02..507ce4d8c 100644 --- a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/nokia.md +++ b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/nokia.md @@ -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": "", diff --git a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md index 02c831757..404b3035b 100644 --- a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md +++ b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md @@ -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 [RFC339 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 { @@ -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" } ] } @@ -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. @@ -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) \ No newline at end of file From 29bffece5e8648a68c65b9aeb87264ac2cf50e50 Mon Sep 17 00:00:00 2001 From: Matej Glemba <32130267+MatejGlemba@users.noreply.github.com> Date: Thu, 18 Jul 2024 14:56:59 +0200 Subject: [PATCH 2/2] fix typo --- .../network-management-protocols/uniconfig_gnmi/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md index 404b3035b..012899c2c 100644 --- a/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md +++ b/frinx-uniconfig/user-guide/network-management-protocols/uniconfig_gnmi/readme.md @@ -124,7 +124,7 @@ To create subscriptions, the following are required in **application.properties* 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 [RFC339 format](https://datatracker.ietf.org/doc/html/rfc3339). +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 @@ -179,4 +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) \ No newline at end of file +- [!ref](iosxr7.md)