The user can add comments to configuration elements. These comments are displayed directly before the element in the outputs of the info, compare, and admin save configuration commands.
Comments are supported in model-driven configuration mode in the configure and li regions. They are not supported in the bof region.
Use the following MD-CLI syntax to add, delete, or modify configuration comments.
annotate [comment-text] string [cli-path] path
The following usage guidelines apply to the annotate command:
[ex:/configure]
A:admin@node-2# router bgp connect-retry 37
*[ex:/configure]
A:admin@node-2# annotate "Line one for connect retry timer \n Line two indented" router bgp connect-retry
*[ex:/configure]
A:admin@node-2# compare /
configure {
router "Base" {
bgp {
+ # comment: Line one for connect retry timer
+ # comment: Line two indented
+ connect-retry 37
}
}
}
*[ex:/configure]
A:admin@node-2# annotate "" /configure router bgp connect-retry
*[ex:/configure]
A:admin@node-2# compare
router "Base" {
bgp {
+ connect-retry 37
}
}
Comments can also be entered using the "# comment: " notation and the following usage guidelines apply:
A comment entry is ignored if a non-configuration element (such as a configuration or operational command) is entered following the comment.
Comments are not displayed in the info command output if any of the following options is used, even if they are used with other supported options:
Copying and pasting a configuration comment from an info command output maintains the association between the comment and element, with the assumption that the comment applies to the configuration element entered on the immediate next line.
[ex:/configure router "Base" bgp]
A:admin@node-2# # comment: Line one for connect-retry
[ex:/configure router "Base" bgp]
A:admin@node-2# # comment: Line two for connect-retry
[ex:/configure router "Base" bgp]
A:admin@node-2# connect-retry 98
*[ex:/configure router "Base" bgp]
A:admin@node-2# # comment: Separate this comment \nfor deterministic-med \n note the blank space
*[ex:/configure router "Base" bgp]
A:admin@node-2# best-path-selection deterministic-med false
*[ex:/configure router "Base" bgp]
A:admin@node-2# info
# comment: Line one for connect-retry
# comment: Line two for connect-retry
connect-retry 98
authentication-key "qvzYGrrZtXg2eqQbniwULbem+PvCH+iycONUiGK7/g==" hash2
ebgp-default-reject-policy {
import false
export false
}
best-path-selection {
# comment: Separate this comment
# comment: for deterministic-med
# comment: note the blank space
deterministic-med false
always-compare-med {
med-value on
strict-as false
}
---snip---
[/]
A:admin@node-2# admin show configuration /configure router bgp
# comment: Line one for connect-retry
# comment: Line two for connect-retry
connect-retry 98
authentication-key "qvzYGrrZtXg2eqQbniwULbem+PvCH+iycONUiGK7/g==" hash2
ebgp-default-reject-policy {
import false
export false
}
best-path-selection {
# comment: Separate this comment
# comment: for deterministic-med
# comment: note the blank space
deterministic-med false
always-compare-med {
med-value on
strict-as false
}
}
---snip---