Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/ip-group/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

1.0.0
+++++
* Make extension from preview to stable.

0.1.1
+++++
* Remove the limitation of max compatible cli core version
Expand Down
25 changes: 13 additions & 12 deletions src/ip-group/azext_ip_group/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
# --------------------------------------------------------------------------------------------

from azure.cli.core import AzCommandsLoader
from azure.cli.core.profiles import register_resource_type

from ._help import helps # pylint: disable=unused-import

Expand All @@ -13,21 +12,23 @@ class IpGroupsCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from ._client_factory import cf_ip_groups
from .profiles import CUSTOM_IP_GROUPS

register_resource_type('latest', CUSTOM_IP_GROUPS, '2019-09-01')

ip_groups_custom = CliCommandType(
operations_tmpl='azext_ip_group.custom#{}',
client_factory=cf_ip_groups)

super(IpGroupsCommandsLoader, self).__init__(cli_ctx=cli_ctx,
custom_command_type=ip_groups_custom,
resource_type=CUSTOM_IP_GROUPS)
operations_tmpl='azext_ip_group.custom#{}')
super().__init__(cli_ctx=cli_ctx, custom_command_type=ip_groups_custom)

def load_command_table(self, args):
from .commands import load_command_table
from azure.cli.core.aaz import load_aaz_command_table
try:
from . import aaz
except ImportError:
aaz = None
if aaz:
load_aaz_command_table(
loader=self,
aaz_pkg_name=aaz.__name__,
args=args
)
load_command_table(self, args)
return self.command_table

Expand Down
31 changes: 0 additions & 31 deletions src/ip-group/azext_ip_group/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,3 @@
# --------------------------------------------------------------------------------------------

from knack.help_files import helps # pylint: disable=unused-import


helps['network ip-group'] = """
type: group
short-summary: Commands to manage IpGroup.
"""

helps['network ip-group create'] = """
type: command
short-summary: Create an IpGroup.
"""

helps['network ip-group list'] = """
type: command
short-summary: List all of IpGroup.
"""

helps['network ip-group delete'] = """
type: command
short-summary: Delete an IpGroup.
"""

helps['network ip-group show'] = """
type: command
short-summary: Show details of an IpGroup.
"""

helps['network ip-group update'] = """
type: command
short-summary: Update an IpGroup.
"""
17 changes: 2 additions & 15 deletions src/ip-group/azext_ip_group/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,8 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------------------------------
# pylint: disable=line-too-long

from azure.cli.core.commands.parameters import tags_type, get_location_type
from azure.cli.core.commands.validators import get_default_location_from_resource_group
# pylint: disable=unused-argument


def load_arguments(self, _):

# region IpGroup
with self.argument_context('network ip-group', min_api='2019-09-01') as c:
c.argument('location', get_location_type(self.cli_ctx), validator=get_default_location_from_resource_group)
c.argument('tags', tags_type)
c.argument('ip_groups_name', options_list=['--name', '-n'], help='Name of the IpGroup')

for verb in ['create', 'update']:
with self.argument_context('network ip-group {}'.format(verb), min_api='2019-09-01') as c:
c.argument('ip_addresses', nargs='+', help='Space-separated list of IpAddress or IpAddressPrefix.')
# endregion
pass
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# coding=utf-8
# --------------------------------------------------------------------------
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------

VERSION = "7.0.0"
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

def network_client_factory(cli_ctx, **kwargs):
from .profiles import CUSTOM_IP_GROUPS
from azure.cli.core.commands.client_factory import get_mgmt_service_client
return get_mgmt_service_client(cli_ctx, CUSTOM_IP_GROUPS, **kwargs)
from azure.cli.core.aaz import *


def cf_ip_groups(cli_ctx, _):
return network_client_factory(cli_ctx).ip_groups
@register_command_group(
"network",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Azure Network resources.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

from azure.cli.core.profiles import CustomResourceType
# pylint: skip-file
# flake8: noqa

CUSTOM_IP_GROUPS = CustomResourceType('azext_ip_group.vendored_sdks', 'NetworkManagementClient')
from .__cmd_group import *
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from azure.cli.core.aaz import *


@register_command_group(
"network ip-group",
)
class __CMDGroup(AAZCommandGroup):
"""Commands to manage IP group.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
#
# Code generated by aaz-dev-tools
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

from .__cmd_group import *
from ._create import *
from ._delete import *
from ._list import *
from ._show import *
from ._update import *
from ._wait import *
Loading