Skip to content

Conversation

@akshayneema
Copy link
Contributor

@akshayneema akshayneema commented Apr 16, 2021

Description
Added tags as an optional argument to az backup vault create command. Now the users will be able to create vaults with tags by giving space-separated tags as command-line arguments.

Testing Guide
az backup vault create -n {vault_name} --location {location_name} -g {rg_name} --tags DeleteBy=12-9999 Owner=akneema

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

c.argument('location', validator=get_default_location_from_resource_group)

with self.argument_context('backup vault create') as c:
c.argument('tags', type=file_type, help='JSON encoded tags. Use the show command with JSON output to see tags format. Modify the values accordingly using a file editor and pass the file path here.', completer=FilesCompleter())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also consider

tags_type = CLIArgumentType(
    validator=validate_tags,
    help="space-separated tags: key[=value] [key[=value] ...]. {}".format(quote_text),
    nargs='*'
)

tag_type = CLIArgumentType(
    type=validate_tag,
    help="a single tag in 'key[=value]' format. {}".format(quote_text),
    nargs='?',
    const=''
)

@qwordy qwordy merged commit e207d54 into Azure:dev Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants