Skip to content

Commit d12600c

Browse files
authored
{virtual-network-tap} Migrate to AAZ Codegen (#8203)
* vnet tap codegen * vtap-config codegen + custom * remove unused * update version * fix style * fix style * update release note
1 parent cd39847 commit d12600c

File tree

698 files changed

+26747
-65296
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

698 files changed

+26747
-65296
lines changed

src/virtual-network-tap/HISTORY.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
Release History
44
===============
55

6+
1.0.0b2
7+
+++++
8+
* Migrate to AAZ
9+
* Add confirmation prompt for network vnet tap delete
10+
* Add confirmation prompt for network nic vtap-config delete
11+
612
1.0.0b1
713
+++++
814
* Replace msrestazure with azure.core

src/virtual-network-tap/azext_vnettap/__init__.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# --------------------------------------------------------------------------------------------
55

66
from azure.cli.core import AzCommandsLoader
7-
from azure.cli.core.profiles import register_resource_type
87

98
import azext_vnettap._help # pylint: disable=unused-import
109

@@ -13,17 +12,24 @@ class VirtualNetworkTapCommandsLoader(AzCommandsLoader):
1312

1413
def __init__(self, cli_ctx=None):
1514
from azure.cli.core.commands import CliCommandType
16-
from .profiles import CUSTOM_VNET_TAP
17-
register_resource_type('latest', CUSTOM_VNET_TAP, '2018-08-01')
18-
19-
super(VirtualNetworkTapCommandsLoader, self).__init__(
20-
cli_ctx=cli_ctx,
21-
custom_command_type=CliCommandType(operations_tmpl='azext_vnettap.custom#{}'),
22-
resource_type=CUSTOM_VNET_TAP
15+
vtap_custom = CliCommandType(
16+
operations_tmpl='azext_vnettap.custom#{}'
2317
)
18+
super().__init__(cli_ctx=cli_ctx, custom_command_type=vtap_custom)
2419

2520
def load_command_table(self, args):
2621
from .commands import load_command_table
22+
from azure.cli.core.aaz import load_aaz_command_table
23+
try:
24+
from . import aaz
25+
except ImportError:
26+
aaz = None
27+
if aaz:
28+
load_aaz_command_table(
29+
loader=self,
30+
aaz_pkg_name=aaz.__name__,
31+
args=args
32+
)
2733
load_command_table(self, args)
2834
return self.command_table
2935

src/virtual-network-tap/azext_vnettap/_client_factory.py

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/virtual-network-tap/azext_vnettap/_help.py

Lines changed: 1 addition & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -3,60 +3,4 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
from knack.help_files import helps
7-
8-
9-
helps['network vnet tap'] = """
10-
type: group
11-
short-summary: Manage virtual network taps.
12-
"""
13-
14-
helps['network vnet tap create'] = """
15-
type: command
16-
short-summary: Create a virtual network tap.
17-
"""
18-
19-
helps['network vnet tap list'] = """
20-
type: command
21-
short-summary: List virtual network taps.
22-
"""
23-
24-
helps['network vnet tap show'] = """
25-
type: command
26-
short-summary: Get the details of a virtual network tap.
27-
"""
28-
29-
helps['network vnet tap update'] = """
30-
type: command
31-
short-summary: Update settings of a virtual network tap.
32-
"""
33-
34-
helps['network vnet tap delete'] = """
35-
type: command
36-
short-summary: Delete a virtual network tap.
37-
"""
38-
39-
helps['network nic vtap-config'] = """
40-
type: group
41-
short-summary: Manage virtual network tap configurations.
42-
"""
43-
44-
helps['network nic vtap-config create'] = """
45-
type: command
46-
short-summary: Create a virtual network tap configuration.
47-
"""
48-
49-
helps['network nic vtap-config delete'] = """
50-
type: command
51-
short-summary: Delete a virtual network tap configuration.
52-
"""
53-
54-
helps['network nic vtap-config list'] = """
55-
type: command
56-
short-summary: List virtual network tap configurations.
57-
"""
58-
59-
helps['network nic vtap-config show'] = """
60-
type: command
61-
short-summary: Get details of a virtual network tap configuration.
62-
"""
6+
from knack.help_files import helps # pylint: disable=unused-import

src/virtual-network-tap/azext_vnettap/_params.py

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,6 @@
33
# Licensed under the MIT License. See License.txt in the project root for license information.
44
# --------------------------------------------------------------------------------------------
55

6-
# pylint: disable=line-too-long
7-
from knack.arguments import CLIArgumentType
86

9-
from azure.cli.core.commands.parameters import (
10-
get_resource_name_completion_list, tags_type)
11-
from azure.cli.core.commands.validators import get_default_location_from_resource_group
12-
13-
from ._validators import validate_vnet_tap
14-
15-
16-
# pylint: disable=too-many-locals, too-many-branches, too-many-statements
17-
def load_arguments(self, _):
18-
19-
tap_name_arg_type = CLIArgumentType(options_list='--tap-name', metavar='NAME', help='Name of the VNet TAP.', id_part='name', completer=get_resource_name_completion_list('Microsoft.Network/virtualNetworkTaps'))
20-
21-
with self.argument_context('network vnet tap') as c:
22-
c.argument('tap_name', tap_name_arg_type, options_list=['--name', '-n'])
23-
c.argument('tags', tags_type)
24-
c.argument('location', validator=get_default_location_from_resource_group)
25-
26-
with self.argument_context('network vnet tap create', arg_group='Destination') as c:
27-
c.argument('destination', help='ID of the ILB or NIC IP configuration to receive the tap.')
28-
c.argument('port', help='The VXLAN port that will receive the tapped traffic.')
29-
30-
with self.argument_context('network nic vtap-config') as c:
31-
c.argument('network_interface_name', options_list='--nic-name', help='Name of the network interface (NIC).', id_part='name')
32-
c.argument('vnet_tap', help='Name or ID of the virtual network tap.', validator=validate_vnet_tap)
33-
for dest in ['vtap_config_name', 'tap_configuration_name']:
34-
c.argument(dest, options_list=['--name', '-n'], help='Name of the virtual network tap configuration.', id_part='child_name_1')
35-
36-
with self.argument_context('network nic vtap-config list') as c:
37-
c.argument('network_interface_name', options_list='--nic-name', help='Name of the network interface (NIC).', id_part=None)
7+
def load_arguments(self, _): # pylint: disable=unused-argument
8+
pass

src/virtual-network-tap/azext_vnettap/_validators.py

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/virtual-network-tap/azext_vnettap/vendored_sdks/models.py renamed to src/virtual-network-tap/azext_vnettap/aaz/__init__.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------------------------
32
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
# --------------------------------------------------------------------------
7-
from .v2018_08_01.models import *
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------

src/virtual-network-tap/azext_vnettap/profiles.py renamed to src/virtual-network-tap/azext_vnettap/aaz/latest/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
# --------------------------------------------------------------------------------------------
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
46
# --------------------------------------------------------------------------------------------
57

6-
from azure.cli.core.profiles import CustomResourceType
8+
# pylint: skip-file
9+
# flake8: noqa
710

8-
CUSTOM_VNET_TAP = CustomResourceType('azext_vnettap.vendored_sdks', 'NetworkManagementClient')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# --------------------------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
7+
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from azure.cli.core.aaz import *
12+
13+
14+
@register_command_group(
15+
"network",
16+
)
17+
class __CMDGroup(AAZCommandGroup):
18+
"""Manage Azure Network resources.
19+
"""
20+
pass
21+
22+
23+
__all__ = ["__CMDGroup"]

src/virtual-network-tap/azext_vnettap/vendored_sdks/version.py renamed to src/virtual-network-tap/azext_vnettap/aaz/latest/network/__init__.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# coding=utf-8
2-
# --------------------------------------------------------------------------
1+
# --------------------------------------------------------------------------------------------
32
# Copyright (c) Microsoft Corporation. All rights reserved.
4-
# Licensed under the MIT License. See License.txt in the project root for
5-
# license information.
6-
# --------------------------------------------------------------------------
3+
# Licensed under the MIT License. See License.txt in the project root for license information.
4+
#
5+
# Code generated by aaz-dev-tools
6+
# --------------------------------------------------------------------------------------------
77

8-
VERSION = "2.2.0"
8+
# pylint: skip-file
9+
# flake8: noqa
10+
11+
from .__cmd_group import *

0 commit comments

Comments
 (0)