cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
192
Views
10
Helpful
2
Replies

What is the difference between a comment and a label?

As part of the commit option, there is a 'comment' and there is a 'label' that I can add to the commit. I am curious what the difference is between these two. I see that both show up in the rollback information, but does one do something the other does not?

 

Example:
admin@ncs% set ebgpPeer name LAX password laxpass peer csr1 asn 100 ip 192.105.1.11
admin@ncs% set ebgpPeer name LAX peer csr2 asn 200 ip 192.105.1.12
admin@ncs% commit comment ?
Possible completions:
Add a commit comment
admin@ncs% commit comment "this is for fun" label "but it should be really fun"
Commit complete.
[ok][2018-10-30 17:25:11]

[edit]
[root@studentnso GSXbgp]#


and from ./logs

[root@studentnso logs]# cat rollback10061
# Created by: admin
# Date: 2018-10-30 17:25:02
# Via: cli
# Type: delta
# Label: but it should be really fun
# Comment: this is for fun
# No: 10061

delete:
ebgpPeer:ebgpPeer LAX;
[root@studentnso logs]#

Everyone's tags (4)
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Cisco Employee

Re: What is the difference between a comment and a label?

You can reference the rollback, through code, using the label. The comment is as you say purely for information.
2 REPLIES 2
Cisco Employee

Re: What is the difference between a comment and a label?

Hi Samuel,

 

Regarding your question, i've observed the yang model and came up with a conclusion.

 

in the confd_lib_maapi(3):

 

       int maapi_set_label(int sock, int thandle, const char *label);

       Set the "Label" that is stored in the rollback file when a transaction
       towards running is committed. Setting the "Label" for transactions via
       candidate can be done when the candidate is committed to running, by
       using the maapi_candidate_commit_info() function. For a confirmed
       commit, the "Label" must also be given via the
       maapi_candidate_confirmed_commit_info() function.

       Errors: CONFD_ERR_MALLOC, CONFD_ERR_OS, CONFD_ERR_NOSESSION,
       CONFD_ERR_NOEXISTS

       int maapi_set_comment(int sock, int thandle, const char *comment);

       Set the "Comment" that is stored in the rollback file when a
       transaction towards running is committed. Setting the "Comment" for
       transactions via candidate can be done when the candidate is committed
       to running, by using the maapi_candidate_commit_info() function. For a
       confirmed commit, the "Comment" must also be given via the
       maapi_candidate_confirmed_commit_info() function.

 

 

This is the most detail i can find regarding your question, but i would assume/suspect that the comment can be used per say a 'descriptive' purpose of the commit while the label would be to very vaguely describe the purpose of the commit or associated some sort of ID that relates to the project associated to the commit transaction.

 

Unfortunately, there is not much information regarding the differences within the yang or NCS CLI.

Highlighted
Cisco Employee

Re: What is the difference between a comment and a label?

You can reference the rollback, through code, using the label. The comment is as you say purely for information.