While the comments seem to work just file via CLI:
thomas@vyos02# comment firewall ipv4 name example2 "CLI Comment" [edit] thomas@vyos02# comment firewall ipv4 name example2 default-action "CLI Comment" [edit] thomas@vyos02# commit [edit] thomas@vyos02# show firewall ipv4 name |grep example2 -B1 -A5 /* CLI Comment */ name example2 { /* CLI Comment */ default-action accept }
I am having some issues settings comments via the API
$ curl -k --location --request POST "https://$VYOS_HOST/configure" --form key="$VYOS_KEY" --form data='[{"op":"comment","path":["firewall","ipv4","name","example2","API Comment"]}] ' {"success": false, "error": "Configuration path: [firewall ipv4 name example2 API Comment] is not valid\n\nComment failed\n", "data": null} $ curl -k --location --request POST "https://$VYOS_HOST/configure" --form key="$VYOS_KEY" --form data='[{"op":"comment","path":["firewall","ipv4","name","example2","default-action","API Comment"]}]' {"success": false, "error": "The specified config node does not exist\nComment failed\n", "data": null}
I am also not able to locate any way to retrieve config comments via the API at all.
$ curl -k --location --request POST "https://$VYOS_HOST/retrieve" --form key="$VYOS_KEY" --form data='{"op":"showConfig","path": ["firewall","ipv4","name","example2"]}' {"success": true, "data": {"default-action": "accept"}, "error": null}
I was hoping to later support using the comments as a way for users to set notes on why configurations are needed, or ticket numbers, or as a key/value store in the same vain as AWS resource tags.
While I don't think modifying the showConfig should be modified and break the interface, maybe a dedicated comment operation would be good for symmetry with the (broken?) comment operation on the /configure endpoint?