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

Useful statements that can be generated for Azure CLI #98

Open
qwordy opened this issue Dec 27, 2019 · 0 comments
Open

Useful statements that can be generated for Azure CLI #98

qwordy opened this issue Dec 27, 2019 · 0 comments

Comments

@qwordy
Copy link
Member

qwordy commented Dec 27, 2019

Add to _params.py:

from azure.cli.core.commands.validators import get_default_location_from_resource_group
from knack.arguments import CLIArgumentType

name_arg_type = CLIArgumentType(options_list=['--name', '-n'], metavar='NAME')
image_template_name = CLIArgumentType(overrides=name_arg_type,
                                          help='The name of the image Template', id_part='name')

c.argument('location', arg_type=get_location_type(self.cli_ctx),
                   validator=get_default_location_from_resource_group)

Add to custom.py:

from knack.util import CLIError
from msrestazure.tools import resource_id, is_valid_resource_id
from azure.cli.core.commands.client_factory import get_subscription_id
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

1 participant