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

Add Subscription RP commands #5453

Closed
wants to merge 16 commits into from
3 changes: 1 addition & 2 deletions azure-cli2017.pyproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<LaunchProvider>Standard Python launcher</LaunchProvider>
<InterpreterId>MSBuild|{54f4b6dc-0859-46dc-99bb-b275c9d0aca3}|$(MSBuildProjectFullPath)</InterpreterId>
<EnableNativeCodeDebugging>False</EnableNativeCodeDebugging>
<CommandLineArguments></CommandLineArguments>
<CommandLineArguments>interactive</CommandLineArguments>
Copy link
Member

Choose a reason for hiding this comment

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

This should be reverted.

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed.

<InterpreterArguments>
</InterpreterArguments>
</PropertyGroup>
Expand Down Expand Up @@ -605,7 +605,6 @@
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\tests\__init__.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\_client_factory.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\_exception_handler.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\_completers.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\_help.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\_params.py" />
<Compile Include="command_modules\azure-cli-subscription\azure\cli\command_modules\subscription\__init__.py" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@
type: group
short-summary: Manage Azure Subscription Definitions.
"""

helps['subscriptiondefinition create'] = """
type: group
short-summary: Create a subscription definition.
"""
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------

from azure.cli.command_modules.subscription._completers import get_offer_type_completion_list
from azure.cli.core.commands.parameters import get_enum_type


# pylint: disable=line-too-long
def load_arguments(self, _):
with self.argument_context('subscriptiondefinition show') as c:
c.argument('subscription_definition_name', options_list=['--name', '-n'], required=False, help='Name of the subscription definition to show.')
c.argument('subscription_definition_name', options_list=['--name', '-n'], help='Name of the subscription definition.')

with self.argument_context('subscriptiondefinition create') as c:
c.argument('name', options_list=['--name', '-n'], required=True, help='Name of the subscription definition.')
c.argument('offer_type', options_list=['--offer_type', '-ot'], required=True, help='The subscription\'s offer type.', completer=get_offer_type_completion_list)
c.argument('subscription_display_name', options_list=['--subscription_display_name', '-sdn'], required=False, help='The subscription display name of the subscription definition.')
c.argument('name', options_list=['--name', '-n'], help='Name of the subscription definition.')
c.argument('offer_type', required=True, help='The subscription\'s offer type.', arg_type=get_enum_type(['MS-AZR-0017P', 'MS-AZR-0148P']))
c.argument('subscription_display_name', options_list=['--subscription-display-name', '-sdn'], help='The subscription display name of the subscription definition.')
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@


def cli_subscription_create_subscription_definition(client, name, offer_type, subscription_display_name=None):
"""Create a subscription definition."""
new_def = SubscriptionDefinition(
subscription_display_name=subscription_display_name if subscription_display_name else name,
offer_type=offer_type)
Expand Down