From 8b824641f47880ed4c72039e28ad1269573a31f2 Mon Sep 17 00:00:00 2001 From: Branislav Malo Date: Tue, 30 Jul 2024 16:57:47 +0200 Subject: [PATCH] [VHD-143] CLI Commands to add or remove tags in a template. - Implement tag operation for adding or removing template tags to/from template config - Internally we use bulk-edit rpc for both operation to comunicate with uniconfig. - Bulk edit with operation "merge" (equivalent to patch method) for adding tags to nodes. - Bulk edit with operation "replace" (equivalent to put method) for removing tags from nodes. - Example of command: - tag add template-topology template1 snmp agent merge-tag - tag remove template-topology template1 networks replace-tag Signed-off-by: Branislav Malo Signed-off-by: Branislav Malo --- .../uniconfig-shell/readme.md | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/readme.md b/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/readme.md index 53024d7b9..67baf9e3e 100644 --- a/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/readme.md +++ b/frinx-uniconfig/user-guide/uniconfig-operations/uniconfig-shell/readme.md @@ -619,6 +619,84 @@ uniconfig-topology-iosxr>show interfaces interface GigabitEthernet0/0/0/1 } ``` +### Tag template + +The `tag` operation for adding or removing tags from template. + +Options: `add` and `remove` + +Then pick `template` under `template-topology` + +Base command pattern: +tag add/remove template-topology + +After base command + +**Example** - Tag a leaf-list: + +```shell Show untagged services leaf-list +config>show template-topology test-template service-node-groups service-node-group default-sng services +[ + "cgnat", + "nextgen-firewall", + "test", + "sdwan" +] +``` + +```shell Add Tag services leaf-list +config>tag +add (invoke add tag explicitly) remove (invoke remove tag explicitly) + +config>tag add template-topology test-template +alarms dhcp-profiles service-node-groups +alias event snmp +confdConfig merge-tag (add merge tag) update-tag (add update tag) +create-tag (add create tag) networks +delete-tag (add delete tag) replace-tag (add replace tag) + +config>tag add template-topology test-template service-node-groups service-node-group default-value services replace-tag +``` + +```shell Show tagged services leaf-list +config>show template-topology test-template service-node-groups service-node-group default-sng services +{ + "@": { + "template-tags:operation": "replace-tag" + }, + "#": [ + "cgnat", + "nextgen-firewall", + "test", + "sdwan" + ] +} +``` + +```shell Remove Tag services leaf-list +config>tag +add (invoke add tag explicitly) remove (invoke remove tag explicitly) + +config>tag add template-topology test-template +alarms dhcp-profiles service-node-groups +alias event snmp +confdConfig merge-tag (add merge tag) update-tag (add update tag) +create-tag (add create tag) networks +delete-tag (add delete tag) replace-tag (add replace tag) + +config>tag remove template-topology test-template service-node-groups service-node-group default-value services replace-tag +``` + +```shell Show untagged services leaf-list +config>show template-topology test-template service-node-groups service-node-group default-sng services +[ + "cgnat", + "nextgen-firewall", + "test", + "sdwan" +] +``` + ### Execute UniConfig operation The `request` command is used to execute UniConfig operations such as `commit`