Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to add a tag with the cli tool #1084

Open
jvalcke opened this issue Oct 19, 2016 · 1 comment
Open

Not possible to add a tag with the cli tool #1084

jvalcke opened this issue Oct 19, 2016 · 1 comment

Comments

@jvalcke
Copy link
Contributor

jvalcke commented Oct 19, 2016

I noticed that it's not possible to add tags to a prefix. The only option via the cli is to set tags, which removes previously defined tags.

Adding tag 'test1'

~$ nipap address modify 67.215.80.0/24 set tags 'service_list=resolver|neteng,location=sin^C
:~$ nipap address modify 1.1.1.1/32 set tags 'test1'
Prefix 1.1.1.1/32 in VRF 'default' [RT: -] saved.
~$ nipap address view 1.1.1.1/32
-- Address
  Prefix                     : 1.1.1.1/32
  Display prefix             : 1.1.1.1
<snip>
-- Extra Attributes
-- Tags
  test1
-- Inherited Tags
-- Comment

Adding, actually setting tag 'test2', removes tag 'test1'

~$ nipap address modify 1.1.1.1/32 set tags 'test2'
Prefix 1.1.1.1/32 in VRF 'default' [RT: -] saved.
~$ nipap address view 1.1.1.1/32
-- Address
  Prefix                     : 1.1.1.1/32
  Display prefix             : 1.1.1.1
<snip>
-- Extra Attributes
-- Tags
  test2
-- Inherited Tags
-- Comment

Is their a way to add tags (keep the existing tags untouched)? Looks like the only add option is extra-attribute

~$ nipap address modify 1.1.1.1/32 add extra-attribute

Am I overlooking something?

@plajjan
Copy link
Member

plajjan commented Oct 30, 2016

You are correct and you are not overlooking anything.

Unlike pretty much all other attributes, tags is an array and so setting the array value means simply that you set the entire array to a given value (which is also an array). This would overwrite any previous value, much like setting the description would overwrite the old description value.

We could definitely add it so that the list of tags can be modified much like extra-attributes can be added / removed individually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants