Skip to content

Commit

Permalink
{Network} az network security-partner-provider: Migrate to CodeGen …
Browse files Browse the repository at this point in the history
…v2 (#23252)

* initial generation

* add wait command

* remove useless code blocks

* re-record test cases

* remove useless code blocks

* refine templates

* add examples
  • Loading branch information
necusjz authored Jul 20, 2022
1 parent 18b51f3 commit f31628b
Show file tree
Hide file tree
Showing 20 changed files with 2,597 additions and 491 deletions.
11 changes: 11 additions & 0 deletions src/azure-cli/azure/cli/command_modules/network/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,17 @@ def __init__(self, cli_ctx=None):

def load_command_table(self, args):
from azure.cli.command_modules.network.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
Original file line number Diff line number Diff line change
Expand Up @@ -272,10 +272,6 @@ def cf_bastion_hosts(cli_ctx, _):
return network_client_factory(cli_ctx).bastion_hosts


def cf_security_partner_providers(cli_ctx, _):
return network_client_factory(cli_ctx).security_partner_providers


def cf_network_virtual_appliances(cli_ctx, _):
return network_client_factory(cli_ctx).network_virtual_appliances

Expand Down
30 changes: 0 additions & 30 deletions src/azure-cli/azure/cli/command_modules/network/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -7559,36 +7559,6 @@
az network bastion tunnel --name MyBastionHost --resource-group MyResourceGroup --target-resource-id vmResourceId --resource-port 22 --port 50022
"""

helps['network security-partner-provider'] = """
type: group
short-summary: Manage Azure security partner provider.
"""

helps['network security-partner-provider create'] = """
type: command
short-summary: Create a Azure security partner provider.
"""

helps['network security-partner-provider update'] = """
type: command
short-summary: Update a Azure security partner provider.
"""

helps['network security-partner-provider delete'] = """
type: command
short-summary: Delete a Azure security partner provider.
"""

helps['network security-partner-provider list'] = """
type: command
short-summary: List all Azure security partner provider.
"""

helps['network security-partner-provider show'] = """
type: command
short-summary: Show a Azure security partner provider.
"""

helps['network virtual-appliance'] = """
type: group
short-summary: Manage Azure Network Virtual Appliance.
Expand Down
8 changes: 0 additions & 8 deletions src/azure-cli/azure/cli/command_modules/network/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2270,14 +2270,6 @@ def load_arguments(self, _):
c.argument('timeout', help='Timeout for connection to bastion host tunnel.', options_list=['--timeout'])
# endregion

# region security partner provider
with self.argument_context('network security-partner-provider') as c:
SecurityProviderName = self.get_models('SecurityProviderName')
c.argument('security_provider_name', arg_type=get_enum_type(SecurityProviderName), help='The security provider name', options_list=['--provider'])
c.argument('security_partner_provider_name', options_list=['--name', '-n'], help='Name of the Security Partner Provider.')
c.argument('virtual_hub', options_list=['--vhub'], help='Name or ID of the virtual hub to which the Security Partner Provider belongs.', validator=validate_virtual_hub)
# endregion

# region PrivateLinkResource and PrivateEndpointConnection
from azure.cli.command_modules.network.private_link_resource_and_endpoint_connections.custom import TYPE_CLIENT_MAPPING, register_providers
register_providers()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +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
@@ -0,0 +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
@@ -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",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Azure Network resources.
"""
pass


__all__ = ["__CMDGroup"]
Original file line number Diff line number Diff line change
@@ -0,0 +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
# --------------------------------------------------------------------------------------------

# pylint: skip-file
# flake8: noqa

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 security-partner-provider",
)
class __CMDGroup(AAZCommandGroup):
"""Manage Azure security partner provider.
"""
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

0 comments on commit f31628b

Please sign in to comment.